-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Duplicated definition references found when Go to Definition
#63895
Comments
Yes, the design is to be cooperative and we only de-dupe items that are exactly the same. What I wonder is why your extension duplicates what types script already computes? |
Thanks for your rapid response, and here is the situation: We want to add supports for some custom import rules like React's Haste, such as:
Now, conflicts occurred
Honestly, another way to solve this is that we guess what typescript Provider can resolve and filter them out. But it's not a reliable or beautiful solution as you know, if users install other Provider extensions or build-in extensions enhancement involved some day, this fragile strategy will be broken Immediately. So a reliable way to control Provider results in such cases is needed. |
it looks like you wanna be a language server plugin: https://github.com/Microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin |
Good idea, and I will investigate this way then. But from my point of view, it's a common situation: when we are keen to enhance Go to Definition functionality, we will see these duplications quickly. Although there are other options in typescript, if any other languages ? P.S. Except for our custom build system, Webpack supports Resolve as well, and I think it's worth considering such general cases. |
Yeah, there can remove duplicates but I don't wanna stretch the definition of a duplicate too much |
Exactly, I know there are no strict duplication problems ( a kind of conflict only ), the reason why stress So, just ignore 'duplicates' and focus on the conflict, and it's a feature request only :) |
We have a similar issue. We have a javascript lerna monorepo and in each package we have babel compiling I wrote a |
The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines. Happy Coding! |
Current Behavior:
External extensions contributed definitions are duplicated with build-in extensions (eg. typescript related extensions), and there is no way for external extensions to know whether other definitions exist or not.
Expected Feature:
Provide an option for
vscode.languages.registerDefinitionProvider
to avoid such conflicts with build-in or other external DefinitionProviders.Alternatively, provide an API to get build-in or all other definitions, just lift conflicts to external extensions.
Steps to Reproduce:
test-def
folder with VS Code, and then Start Debuggingtest-def/src
folder with [Extension Development Host], and opentest-def/src/extensions.ts
import * as test from './test/index';
Go to Definition of./test/index
Further More:
The exactly same definitions will be filtered, so I tried to provide the same definition with build-in result, and failed as well:
The text was updated successfully, but these errors were encountered: