Skip to content

Fix go to definition with overridden methods #5208

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 1 commit into from
Oct 10, 2018

Conversation

Duhemm
Copy link
Contributor

@Duhemm Duhemm commented Oct 5, 2018

When doing go to definition on a reference, we are supposed to look for
the symbol under the cursor, and the symbols that override it in the
same source file. We were previously looking only in the tree of the
first definition, and would not inspect the rest of the sourcefile.

When doing go to definition on a reference, we are supposed to look for
the symbol under the cursor, and the symbols that override it in the
same source file. We were previously looking only in the tree of the
first definition, and would not inspect the rest of the sourcefile.
@Duhemm Duhemm force-pushed the fix/go-to-definition-overridden branch from 632f3cc to 214e277 Compare October 10, 2018 09:14
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

LGTM, but I think we should simplify the logic here and look for definitions in the whole codebase all the time, it's slow the first time but now that we have a cache it's not too bad afterwards. (Eventually it'd be great if we could stream responses to queries so that we can both have a fast first response and a complete response afterwards, but that still seems a long way off: microsoft/language-server-protocol#182)

@smarter
Copy link
Member

smarter commented Oct 10, 2018

(Note that my suggestions are for future improvements, this is good to go as is)

@smarter smarter merged commit 07f15aa into scala:master Oct 10, 2018
@allanrenucci allanrenucci deleted the fix/go-to-definition-overridden branch October 10, 2018 16:18
Duhemm added a commit to dotty-staging/dotty that referenced this pull request Nov 19, 2018
When doing go-to-definition, we used to look for symbols that override
the symbol selected for go to definition only in the same source file as
the one that was selected. This commit changes that, as suggested in the
review of scala#5208.
Duhemm added a commit to dotty-staging/dotty that referenced this pull request Nov 30, 2018
When doing go-to-definition, we used to look for symbols that override
the symbol selected for go to definition only in the same source file as
the one that was selected. This commit changes that, as suggested in the
review of scala#5208.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants