-
Notifications
You must be signed in to change notification settings - Fork 288
Implement 'range' property for hover response #485
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
Conversation
|
Thanks for your interest in palantir/python-language-server, @vhakulinen! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
gatesn
left a comment
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.
Thank you for this contribution, really nice. Couple of small comments then should be good to go
|
|
||
| return { | ||
| 'contents': _utils.format_docstring(definitions[0].docstring()) or "", | ||
| 'range': pos, |
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.
Can you inline pos here
| @@ -1,5 +1,6 @@ | |||
| # Copyright 2017 Palantir Technologies, Inc. | |||
| import logging | |||
| import json | |||
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.
Unused?
| if position['line'] >= len(self.lines): | ||
| return None | ||
|
|
||
| line = self.lines[position['line']] |
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.
Can you add a test for this method explicitly?
|
Copying over to a local branch so I can finish up the changes |
|
Sorry, I completely forgot this while doing other stuff. |
Include
rangeproperty for thetextDocument/hoverresponse: https://microsoft.github.io/language-server-protocol/specification#textDocument_hover.