-
Notifications
You must be signed in to change notification settings - Fork 201
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
Feature/completion item/resolve #25
Changes from all commits
7d3a76c
be8c2e3
807b371
f11c943
24911a8
c51f5b6
b4a9565
7c1ebf1
79fc79f
ed4cd41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,8 +162,8 @@ def capabilities(self): | |
'resolveProvider': False, # We may need to make this configurable | ||
}, | ||
'completionProvider': { | ||
'resolveProvider': False, # We know everything ahead of time | ||
'triggerCharacters': ['.'] | ||
'resolveProvider': True, # We could know everything ahead of time, but this takes time to transfer | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this value is True, then it means that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
IMO no,
No, the client is still allowed to call |
||
'triggerCharacters': ['.'], | ||
}, | ||
'documentFormattingProvider': True, | ||
'documentHighlightProvider': True, | ||
|
@@ -250,6 +250,10 @@ def completions(self, doc_uri, position): | |
'items': flatten(completions) | ||
} | ||
|
||
def completion_item_resolve(self, completion_item): | ||
doc_uri = completion_item.get('data', {}).get('doc_uri', None) | ||
return self._hook('pylsp_completion_item_resolve', doc_uri, completion_item=completion_item) | ||
|
||
def definitions(self, doc_uri, position): | ||
return flatten(self._hook('pylsp_definitions', doc_uri, position=position)) | ||
|
||
|
@@ -296,6 +300,9 @@ def signature_help(self, doc_uri, position): | |
def folding(self, doc_uri): | ||
return flatten(self._hook('pylsp_folding_range', doc_uri)) | ||
|
||
def m_completion_item__resolve(self, **completionItem): | ||
return self.completion_item_resolve(completionItem) | ||
|
||
def m_text_document__did_close(self, textDocument=None, **_kwargs): | ||
workspace = self._match_uri_to_workspace(textDocument['uri']) | ||
workspace.rm_document(textDocument['uri']) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how we should manage these kind of configuration options that apply to both jedi, rope and possibly other completion backends
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think splitting them by plugin is fine because some plugins may be very fast to eagerly resolve completions and some may be slow. It might be beneficial to let user/IDE make this choice (not necessarily today with rope and jedi as only completion providers, but potentially in the future).
This made me realise I missed adding the setting to schema for
rope
...