Skip to content

Commit a231b23

Browse files
committed
Fix start position on JSDoc parsin
1 parent 98e9e77 commit a231b23

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7694,7 +7694,7 @@ namespace ts {
76947694
typeExpression = tryParseTypeExpression();
76957695
}
76967696

7697-
const comment = parseTrailingTagComments(indent + scanner.getStartPos() - start, getNodePos(), indent, indentText);
7697+
const comment = parseTrailingTagComments(start, getNodePos(), indent, indentText);
76987698

76997699
const nestedTypeLiteral = target !== PropertyLikeParse.CallbackParameter && parseNestedTypeLiteral(typeExpression, name, target, indent);
77007700
if (nestedTypeLiteral) {

tests/cases/fourslash/commentsLinePreservation.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,16 @@ verify.quickInfos({
129129
3: ["(parameter) param1: string", "first line of param\n\nparam information third line"],
130130

131131
g: ["function g(param1: string): void", "This is firstLine\nThis is second Line"],
132-
4: ["(parameter) param1: string", "param information first line"],
132+
4: ["(parameter) param1: string", " param information first line"],
133133

134134
h: ["function h(param1: string): void", "This is firstLine\nThis is second Line"],
135-
5: ["(parameter) param1: string", "param information first line\n\nparam information third line"],
135+
5: ["(parameter) param1: string", " param information first line\n\n param information third line"],
136136

137137
i: ["function i(param1: string): void", "This is firstLine\nThis is second Line"],
138-
6: ["(parameter) param1: string", "param information first line\n\nparam information third line"],
138+
6: ["(parameter) param1: string", " param information first line\n\n param information third line"],
139139

140140
j: ["function j(param1: string): void", "This is firstLine\nThis is second Line"],
141-
7: ["(parameter) param1: string", "param information first line\n\nparam information third line"],
141+
7: ["(parameter) param1: string", " param information first line\n\n param information third line"],
142142

143143
k: ["function k(param1: string): void", "This is firstLine\nThis is second Line"],
144144
8: ["(parameter) param1: string", "hello"],

0 commit comments

Comments
 (0)