Avoid some common type casts

Casts can hide some type errors
This commit is contained in:
Matt Bierner
2019-01-03 16:59:13 -08:00
parent cd88417f49
commit 3f8579f96a
5 changed files with 147 additions and 147 deletions

View File

@@ -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;
};
});
}