Skip to content

Commit 12f8bf6

Browse files
authored
Merge pull request #3468 from ajaybhargavb/ajbaaska/gtd-fix
Fix DefinitionProvider being overly defensive
2 parents 242a317 + ac54fe3 commit 12f8bf6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/features/definitionProvider.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default class CSharpDefinitionProvider extends AbstractSupport implements
2121
this._definitionMetadataDocumentProvider = definitionMetadataDocumentProvider;
2222
}
2323

24-
public async provideDefinition(document: TextDocument, position: Position, token: CancellationToken): Promise<Location> {
24+
public async provideDefinition(document: TextDocument, position: Position, token: CancellationToken): Promise<Location[]> {
2525

2626
let req = <GoToDefinitionRequest>createRequest(document, position);
2727
req.WantMetadata = true;
@@ -65,14 +65,10 @@ export default class CSharpDefinitionProvider extends AbstractSupport implements
6565

6666
// Allow language middlewares to re-map its edits if necessary.
6767
const result = await this._languageMiddlewareFeature.remap("remapLocations", [location], token);
68-
if (result && result.length == 1) {
69-
return result[0];
70-
}
71-
72-
return location;
68+
return result;
7369
}
7470
catch (error) {
75-
return;
71+
return [];
7672
}
7773
}
7874
}

0 commit comments

Comments
 (0)