Skip to content

Validate if shared_data is not None when resolving completion items #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pylsp/plugins/jedi_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ def pylsp_completions(config, document, position):
@hookimpl
def pylsp_completion_item_resolve(completion_item, document):
"""Resolve formatted completion for given non-resolved completion"""
completion, data = document.shared_data['LAST_JEDI_COMPLETIONS'].get(completion_item['label'])
return _resolve_completion(completion, data)
shared_data = document.shared_data['LAST_JEDI_COMPLETIONS'].get(completion_item['label'])
if shared_data:
completion, data = shared_data
return _resolve_completion(completion, data)
return completion_item


def is_exception_class(name):
Expand Down