Remove any casts

This commit is contained in:
Matt Bierner 2020-08-10 12:12:37 -07:00
parent 5e697b348c
commit 6dd0a9a64d

View file

@ -39,10 +39,10 @@ export default class TypeScriptDefinitionProvider extends DefinitionProviderBase
return response.body.definitions
.map((location): vscode.DefinitionLink => {
const target = typeConverters.Location.fromTextSpan(this.client.toResource(location.file), location);
if ((location as any).contextStart) {
if (location.contextStart && location.contextEnd) {
return {
originSelectionRange: span,
targetRange: typeConverters.Range.fromLocations((location as any).contextStart, (location as any).contextEnd),
targetRange: typeConverters.Range.fromLocations(location.contextStart, location.contextEnd),
targetUri: target.uri,
targetSelectionRange: target.range,
};