extensions/typescript-language-features/src/languageFeatures/rename.ts/TypeScriptRenameProvider/prepareRename
class TypeScriptRenameProvider:	public async prepareRename(
		document: vscode.TextDocument,
		position: vscode.Position,
		token: vscode.CancellationToken
	): Promise<vscode.Range | null> {
		if (this.client.apiVersion.lt(API.v310)) {
			return null;
		}

		const response = await this.execRename(document, position, token);
		if (response?.type !== 'response' || !response.body) {
			return null;
		}

		const renameInfo = response.body.info;
		if (!renameInfo.canRename) {
			return Promise.reject<vscode.Range>(renameInfo.localizedErrorMessage);
		}

		return typeConverters.Range.fromTextSpan(renameInfo.triggerSpan);
	}