Skip to content

Commit 58b229b

Browse files
authored
Validate if shared_data is not None when resolving completion items (#59)
* Validate if shared_data is not None when resolving items * Fix Pylint warning
1 parent 1d7091b commit 58b229b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pylsp/plugins/jedi_completion.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,11 @@ def pylsp_completions(config, document, position):
107107
@hookimpl
108108
def pylsp_completion_item_resolve(completion_item, document):
109109
"""Resolve formatted completion for given non-resolved completion"""
110-
completion, data = document.shared_data['LAST_JEDI_COMPLETIONS'].get(completion_item['label'])
111-
return _resolve_completion(completion, data)
110+
shared_data = document.shared_data['LAST_JEDI_COMPLETIONS'].get(completion_item['label'])
111+
if shared_data:
112+
completion, data = shared_data
113+
return _resolve_completion(completion, data)
114+
return completion_item
112115

113116

114117
def is_exception_class(name):

0 commit comments

Comments
 (0)