Skip to content
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

Merged
merged 4 commits into from
May 5, 2013
Merged

Conversation

JazzCore
Copy link
Contributor

@JazzCore JazzCore commented May 3, 2013

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, while goto 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.

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]
Copy link
Member

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()?

Copy link
Contributor Author

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.

@Valloric
Copy link
Member

Valloric commented May 4, 2013

This is good, thanks. Implement GoToDefinitionElseDeclaration (see docs) and this should be good to merge.

@JazzCore
Copy link
Contributor Author

JazzCore commented May 4, 2013

Should be good now. Still need to update docs though.

def _GoToDefinition( self ):
definitions = self._GetDefinitionsList()
if definitions:
self._JumpToLocation(definitions)
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Valloric added a commit that referenced this pull request May 5, 2013
Add Go To features for python
@Valloric Valloric merged commit f25bf2f into ycm-core:master May 5, 2013
@Valloric
Copy link
Member

Valloric commented May 5, 2013

This was a great pull, thanks!

@JazzCore
Copy link
Contributor Author

JazzCore commented May 5, 2013

Glad to help :)

@JazzCore JazzCore deleted the goto_python branch May 5, 2013 17:07
bijancn pushed a commit to bijancn/YouCompleteMe that referenced this pull request Jul 26, 2016
… 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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants