Change:
Issue Type: <bBug</bGitHub Pull Request extension repo Hover on Press CMD key ! Ideally we should be able to implementation of at the top and definition at the bottom, but :( VS Code version: Code - Insiders 1.34.0-insider (, 2019-04-09T05:14:40.620Z) OS version: Darwin x64 18.5.0 <details<summarySystem Info</summary </details<details<summaryExtensions (50)</summaryExtensionVersion ------ vscode-apollo1.5.2 markdown-emoji0.0.7 solargraph0.19.6 npm-intellisense1.3.0 vscode-svgviewer2.0.0 vscode-markdownlint0.26.0 vscode-eslint1.8.2 xml2.4.0 gitlens9.6.0 remotehub0.2.0 tsl-problem-matcher0.0.4 EditorConfig0.13.0 tslint1.0.43 vscode-npm-script0.3.5 vsc-material-theme2.8.2 prettier-vscode1.8.1 flow-for-vscode1.1.1 vscode-pull-request-github-insiders1.98.0 ocaml0.6.43 beautify1.4.11 references-plusplus0.0.5 graphql-for-vscode1.13.0 dotenv1.0.1 theme-monokai-pro-vscode1.1.12 vscode-azurefunctions0.16.0 vscode-language-pack-zh-hans1.33.2 python2019.3.6558 azure-account0.8.1 cpptools0.22.1 Go0.9.2 powershell1.12.0 vscode-typescript-tslint-plugin1.0.0 wordcount0.1.0 vsliveshare1.0.18 debugger-for-chrome4.11.3 debugger-for-ios-web0.1.2 vetur0.18.1 subtitles-editor1.0.2 vscode-versionlens0.22.0 material-icon-theme3.7.0 seti-icons0.1.3 ruby0.22.3 smartpaste0.0.3 toggle0.0.1 vscode-fuzzsymbols0.0.1 sass-indented1.5.1 rust0.6.1 sourcekit-lsp0.0.1 vscode-lldb1.2.2 vscode-intelli-nav0.0.6 (12 theme extensions excluded) </details<!-- generated by issue reporter --
adding since I believe the implementation peak when holding CMD is determined by VS Code
Yeah, today we count matching bracket (up to a low maximum of lines) to compute the preview. not sure if TypeScript provides  but that would certainly help here
Ok, we do set the but it is just the range of the identifier (). I've opened to track having this information returned from TypeScript
Planning to do work to support API proposed by in June. We would not actually ship this until TS 3.6 however
To verify, please make sure you are using TS 3.6 in your workspace and follow original instructions in the github PR extension's codebase

Discussion:
return response.body.definitions .map((location): vscode.DefinitionLink => { const target = typeConverters.Location.fromTextSpan(this.client.toResource(location.file), location); <ins> if ((location as any).contextStart) { return { originSelectionRange: span, targetRange: typeConverters.Range.fromLocations((location as any).contextStart, (location as any).contextEnd), targetUri: target.uri, targetSelectionRange: target.range, }; } </ins> return { originSelectionRange: span, targetRange: target.range, <del> targetUri: target.uri, </del> <ins> targetUri: target.uri </ins> }; }); }

export namespace Range { export const fromTextSpan = (span: Proto.TextSpan): vscode.Range => <ins> fromLocations(span.start, span.end); export const fromLocations = (start: Proto.Location, end: Proto.Location): vscode.Range => </ins> new vscode.Range( <del> Math.max(0, span.start.line - 1), Math.max(span.start.offset - 1, 0), Math.max(0, span.end.line - 1), Math.max(0, span.end.offset - 1)); </del> <ins> Math.max(0, start.line - 1), Math.max(start.offset - 1, 0), Math.max(0, end.line - 1), Math.max(0, end.offset - 1)); </ins> export const toFileRangeRequestArgs = (file: string, range: vscode.Range): Proto.FileRangeRequestArgs => ({ file,

import { onUnexpectedError } from 'vs/base/common/errors'; import { MarkdownString } from 'vs/base/common/htmlContent'; import { IModeService } from 'vs/editor/common/services/modeService'; <del> import { Range } from 'vs/editor/common/core/range'; </del> <ins> import { Range, IRange } from 'vs/editor/common/core/range'; </ins> import * as editorCommon from 'vs/editor/common/editorCommon'; import { DefinitionProviderRegistry, LocationLink } from 'vs/editor/common/modes'; import { ICodeEditor, IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser';

return; } <del> const previewValue = this.getPreviewValue(textEditorModel, startLineNumber); </del> <ins> const previewValue = this.getPreviewValue(textEditorModel, startLineNumber, result); </ins> let wordRange: Range; if (result.originSelectionRange) {

}).then(undefined, onUnexpectedError); } <del> private getPreviewValue(textEditorModel: ITextModel, startLineNumber: number) { let rangeToUse = this.getPreviewRangeBasedOnBrackets(textEditorModel, startLineNumber); </del> <ins> private getPreviewValue(textEditorModel: ITextModel, startLineNumber: number, result: LocationLink) { let rangeToUse = result.targetSelectionRange ? result.range : this.getPreviewRangeBasedOnBrackets(textEditorModel, startLineNumber); </ins> const numberOfLinesInRange = rangeToUse.endLineNumber - rangeToUse.startLineNumber; if (numberOfLinesInRange >= GotoDefinitionWithMouseEditorContribution.MAX_SOURCE_PREVIEW_LINES) { rangeToUse = this.getPreviewRangeBasedOnIndentation(textEditorModel, startLineNumber);

return previewValue; } <del> private stripIndentationFromPreviewRange(textEditorModel: ITextModel, startLineNumber: number, previewRange: Range) { </del> <ins> private stripIndentationFromPreviewRange(textEditorModel: ITextModel, startLineNumber: number, previewRange: IRange) { </ins> const startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber); let minIndent = startIndent;