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:
- Clone the test-def repo
- Open
test-def folder with VS Code, and then Start Debugging
- Open
test-def/src folder with [Extension Development Host], and open test-def/src/extensions.ts
import * as test from './test/index'; Go to Definition of ./test/index
- Two definitions found
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:
public provideDefinition(
document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken):
Thenable<vscode.Location> {
console.log('trigger GoDefinitionProvider at ' + Date.now());
return new Promise((resolve) => {
// ... Do some stuff to find definitions
let file = path.join(__dirname, '../src/test/index.ts');
console.log('resolve some thing ' + file);
vscode.workspace.openTextDocument(file).then(doc => {
// default range
// {startLineNumber: 13, startColumn: 1, endLineNumber: 22, endColumn: 29}
let range = doc.validateRange(new vscode.Range(new vscode.Position(0, 0), new vscode.Position(99999, 99999)));
//!!! Change startPosition.line to 12 will do the trick,
// but there's no way to know other definitions exactly.
// let range = doc.validateRange(new vscode.Range(new vscode.Position(12, 0), new vscode.Position(99999, 99999)));
console.log(range);
resolve(new vscode.Location(
vscode.Uri.file(file),
range
));
});
})
}
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.registerDefinitionProviderto 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-deffolder with VS Code, and then Start Debuggingtest-def/srcfolder with [Extension Development Host], and opentest-def/src/extensions.tsimport * as test from './test/index';Go to Definition of./test/indexFurther More:
The exactly same definitions will be filtered, so I tried to provide the same definition with build-in result, and failed as well: