-
Notifications
You must be signed in to change notification settings - Fork 243
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
Emit references and definitions for the same anchor #4021
Comments
Using |
IIRC from the outcome of that discussion, the test should also include:
|
As discussed in context of Python's Example:
|
@robinp. I think yes. And as others have mentioned, there is an issue of practicality here for the user. In something like from foo import * # imports a, b
myval = a + b It may be expected that clicking on |
What is the current status on this issue? Was it blocked on CodeSearch not properly supporting it? |
Largely, yes. CodeSearch always prefers definitions when an anchor has both. While there are still some issues with this approach, (notably for Go's embedded fields) it resolves the specific issue referenced from this bug. It's fine for indexers to emit overlapping references and definitions; UIs should probably prefer definitions if they have to pick a single one, but should probably present users with some choice. |
Sorry, I'm not sure if the Python indexer does this or not, but it should be able to at this point. |
See a much longer discussion at #3934.
The Python indexer, and since #3990 the TypeScript indexer, deal with imports defining a local import declaration and referencing a remote definition by creating a unique anchor for the import definitions and a unique anchor for the import reference.
This is done because the most popular Kythe UI currently chooses an anchor as referencing other semantic nodes or defining a semantic node, but not both.
If the UI is extended to support both definitions and references on one anchor, this can be closed and we can emit definitions and references on the same anchor.
The text was updated successfully, but these errors were encountered: