-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add Go To features for python #292
Conversation
This adds a Go To Definition and Go To Declaration features for python.
|
||
def _JumpToLocation( self, definition_list ): | ||
if len( definition_list ) == 1: | ||
definition = list( definition_list )[0] |
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.
Why are you wrapping it in list()
?
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.
My bad, forgot to remove this. goto() and get_definition() returns a list so type casting is not needed.
This is good, thanks. Implement |
Should be good now. Still need to update docs though. |
def _GoToDefinition( self ): | ||
definitions = self._GetDefinitionsList() | ||
if definitions: | ||
self._JumpToLocation(definitions) |
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.
Space after (
and before )
(except when empty parens). Same for other locations.
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.
Done
This was a great pull, thanks! |
Glad to help :) |
… r=Valloric Improves semantic trigger match. Improves semantic trigger match. Match triggers until user's caret column solely. Trying to match triggers with characters after user's caret column doesn't seem to have any utility. --- This is the first in a series of pull-requests that will transparently enable ycm-core#1300 for any completer that cares for. After this minimal foundation is stablished, an initial Swift completer will be available, supporting diagnostics, fix-it's, semantic completion and argument hints. Changes will also be proposed to enable hints for C and C++. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/292) <!-- Reviewable:end -->
This PR adds a Go To Definition and Go To Declaration for python. Jedi has a 2 goto functions, they are well documented. Basically,
get_definition
acts more like go to declaration, whilegoto
acts like go to definition.Since both methods can return multiple definitions we need to pass all of them to the user, so he can make a decision. This is done by opening a quickfix window with a
youcompleteme#OpenGoToList
method.