Skip to content

Commit de47614

Browse files
committed
Fix error when resolving completion items for Rope
1 parent fb6f1ed commit de47614

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pylsp/plugins/rope_completion.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@ def pylsp_completions(config, workspace, document, position):
8383
@hookimpl
8484
def pylsp_completion_item_resolve(completion_item, document):
8585
"""Resolve formatted completion for given non-resolved completion"""
86-
completion, data = document.shared_data['LAST_ROPE_COMPLETIONS'].get(completion_item['label'])
87-
return _resolve_completion(completion, data)
86+
shared_data = document.shared_data['LAST_ROPE_COMPLETIONS'].get(completion_item['label'])
87+
if shared_data:
88+
completion, data = shared_data
89+
return _resolve_completion(completion, data)
90+
return completion_item
8891

8992

9093
def _sort_text(definition):

0 commit comments

Comments
 (0)