diff --git a/packages/language-server/src/plugins/typescript/DocumentSnapshot.ts b/packages/language-server/src/plugins/typescript/DocumentSnapshot.ts index da5c09351..4fb9ecfdd 100644 --- a/packages/language-server/src/plugins/typescript/DocumentSnapshot.ts +++ b/packages/language-server/src/plugins/typescript/DocumentSnapshot.ts @@ -664,7 +664,7 @@ export class DtsDocumentSnapshot extends JSOrTSDocumentSnapshot implements Docum } return { - line: mapped.line, + line: mapped.line - 1, character: mapped.column, uri: pathToUrl(originalFilePath) }; diff --git a/packages/language-server/test/plugins/typescript/TypescriptPlugin.test.ts b/packages/language-server/test/plugins/typescript/TypescriptPlugin.test.ts index 8ef10793e..9e65beb1c 100644 --- a/packages/language-server/test/plugins/typescript/TypescriptPlugin.test.ts +++ b/packages/language-server/test/plugins/typescript/TypescriptPlugin.test.ts @@ -569,12 +569,12 @@ describe('TypescriptPlugin', function () { assert.deepStrictEqual(definition, [ { targetRange: { - end: { line: 1, character: 18 }, - start: { line: 1, character: 16 } + end: { line: 0, character: 18 }, + start: { line: 0, character: 16 } }, targetSelectionRange: { - start: { line: 1, character: 16 }, - end: { line: 1, character: 18 } + start: { line: 0, character: 16 }, + end: { line: 0, character: 18 } }, originSelectionRange: { start: { line: 1, character: 13 }, @@ -592,12 +592,12 @@ describe('TypescriptPlugin', function () { assert.deepStrictEqual(definition, [ { targetRange: { - end: { line: 1, character: 18 }, - start: { line: 1, character: 16 } + end: { line: 0, character: 18 }, + start: { line: 0, character: 16 } }, targetSelectionRange: { - start: { line: 1, character: 16 }, - end: { line: 1, character: 18 } + start: { line: 0, character: 16 }, + end: { line: 0, character: 18 } }, originSelectionRange: { start: { line: 1, character: 13 }, diff --git a/packages/language-server/test/plugins/typescript/features/FindReferencesProvider.test.ts b/packages/language-server/test/plugins/typescript/features/FindReferencesProvider.test.ts index aa160034a..c68e3679a 100644 --- a/packages/language-server/test/plugins/typescript/features/FindReferencesProvider.test.ts +++ b/packages/language-server/test/plugins/typescript/features/FindReferencesProvider.test.ts @@ -319,8 +319,8 @@ describe('FindReferencesProvider', function () { assert.deepStrictEqual(references, [ { range: { - end: { line: 1, character: 18 }, - start: { line: 1, character: 16 } + end: { line: 0, character: 18 }, + start: { line: 0, character: 16 } }, uri: getUri('declaration-map/declaration-map-project/index.ts') }, diff --git a/packages/language-server/test/plugins/typescript/features/ImplemenationProvider.test.ts b/packages/language-server/test/plugins/typescript/features/ImplemenationProvider.test.ts index c272b0ebb..57ad86192 100644 --- a/packages/language-server/test/plugins/typescript/features/ImplemenationProvider.test.ts +++ b/packages/language-server/test/plugins/typescript/features/ImplemenationProvider.test.ts @@ -89,8 +89,8 @@ describe('ImplementationProvider', function () { assert.deepStrictEqual(implementations, [ { range: { - end: { line: 1, character: 18 }, - start: { line: 1, character: 16 } + end: { line: 0, character: 18 }, + start: { line: 0, character: 16 } }, uri: getUri('../declaration-map/declaration-map-project/index.ts') } diff --git a/packages/language-server/test/plugins/typescript/features/TypeDefinitionProvider.test.ts b/packages/language-server/test/plugins/typescript/features/TypeDefinitionProvider.test.ts index 9a38c34d4..f4e0baa44 100644 --- a/packages/language-server/test/plugins/typescript/features/TypeDefinitionProvider.test.ts +++ b/packages/language-server/test/plugins/typescript/features/TypeDefinitionProvider.test.ts @@ -98,8 +98,8 @@ describe('TypeDefinitionProvider', function () { assert.deepStrictEqual(typeDefs, [ { range: { - end: { line: 1, character: 18 }, - start: { line: 1, character: 16 } + end: { line: 0, character: 18 }, + start: { line: 0, character: 16 } }, uri: getUri('../declaration-map/declaration-map-project/index.ts') }