mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 19:59:37 +00:00
Avoid some common type casts
Casts can hide some type errors
This commit is contained in:
@@ -35,13 +35,13 @@ export default class TypeScriptDefinitionProvider extends DefinitionProviderBase
|
||||
|
||||
const span = response.body.textSpan ? typeConverters.Range.fromTextSpan(response.body.textSpan) : undefined;
|
||||
return response.body.definitions
|
||||
.map(location => {
|
||||
.map((location): vscode.DefinitionLink => {
|
||||
const target = typeConverters.Location.fromTextSpan(this.client.toResource(location.file), location);
|
||||
return {
|
||||
originSelectionRange: span,
|
||||
targetRange: target.range,
|
||||
targetUri: target.uri,
|
||||
} as vscode.DefinitionLink;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user