mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Use type converter to convert location
This commit is contained in:
parent
6d075f773b
commit
a1e58c9ea8
|
@ -25,7 +25,6 @@ export default class TypeScriptImplementationsCodeLensProvider extends TypeScrip
|
||||||
try {
|
try {
|
||||||
const response = await this.client.execute('implementation', args, token);
|
const response = await this.client.execute('implementation', args, token);
|
||||||
if (response && response.body) {
|
if (response && response.body) {
|
||||||
|
|
||||||
const locations = response.body
|
const locations = response.body
|
||||||
.map(reference =>
|
.map(reference =>
|
||||||
// Only take first line on implementation: https://github.com/Microsoft/vscode/issues/23924
|
// Only take first line on implementation: https://github.com/Microsoft/vscode/issues/23924
|
||||||
|
@ -33,8 +32,8 @@ export default class TypeScriptImplementationsCodeLensProvider extends TypeScrip
|
||||||
reference.start.line === reference.end.line
|
reference.start.line === reference.end.line
|
||||||
? typeConverters.Range.fromTextSpan(reference)
|
? typeConverters.Range.fromTextSpan(reference)
|
||||||
: new vscode.Range(
|
: new vscode.Range(
|
||||||
reference.start.line - 1, reference.start.offset - 1,
|
typeConverters.Position.fromLocation(reference.start),
|
||||||
reference.start.line, 0)))
|
new vscode.Position(reference.start.line, 0))))
|
||||||
// Exclude original from implementations
|
// Exclude original from implementations
|
||||||
.filter(location =>
|
.filter(location =>
|
||||||
!(location.uri.toString() === codeLens.document.toString() &&
|
!(location.uri.toString() === codeLens.document.toString() &&
|
||||||
|
|
Loading…
Reference in a new issue