Skip to content

Commit

Permalink
fix: correct declareMap reference line number (#2250)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlyu123 authored Jan 10, 2024
1 parent 6ba86d2 commit b05c8ee
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,12 @@ describe('TypescriptPlugin', function () {
assert.deepStrictEqual(definition, [
<LocationLink>{
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 },
Expand All @@ -592,12 +592,12 @@ describe('TypescriptPlugin', function () {
assert.deepStrictEqual(definition, [
<LocationLink>{
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 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ describe('FindReferencesProvider', function () {
assert.deepStrictEqual(references, <Location[]>[
{
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')
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ describe('ImplementationProvider', function () {
assert.deepStrictEqual(implementations, <Location[]>[
{
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')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ describe('TypeDefinitionProvider', function () {
assert.deepStrictEqual(typeDefs, <Location[]>[
{
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')
}
Expand Down

0 comments on commit b05c8ee

Please sign in to comment.