extensions/typescript-language-features/src/languageFeatures/definitions.ts/TypeScriptDefinitionProvider/provideDefinition
class TypeScriptDefinitionProvider:	public async provideDefinition(
		document: vscode.TextDocument,
		position: vscode.Position,
		token: vscode.CancellationToken
	): Promise<vscode.DefinitionLink[] | vscode.Definition | undefined> {
		if (this.client.apiVersion.gte(API.v270)) {
			const filepath = this.client.toOpenedFilePath(document);
			if (!filepath) {
				return undefined;
			}

			const args = typeConverters.Position.toFileLocationRequestArgs(filepath, position);
			const response = await this.client.execute('definitionAndBoundSpan', args, token);
			if (response.type !== 'response' || !response.body) {
				return undefined;
			}

			const span = response.body.textSpan ? typeConverters.Range.fromTextSpan(response.body.textSpan) : undefined;
			return response.body.definitions
				.map((location): vscode.DefinitionLink => {
					const target = typeConverters.Location.fromTextSpan(this.client.toResource(location.file), location);
					if (location.contextStart && location.contextEnd) {
						return {
							originSelectionRange: span,
							targetRange: typeConverters.Range.fromLocations(location.contextStart, location.contextEnd),
							targetUri: target.uri,
							targetSelectionRange: target.range,
						};
					}
					return {
						originSelectionRange: span,
						targetRange: target.range,
						targetUri: target.uri
					};
				});
		}

		return this.getSymbolLocations('definition', document, position, token);
	}