Skip to content

Commit 1f8eae7

Browse files
author
Andy Hanson
committed
Fix bug: Ensure JSDoc type range is valid
1 parent dd9b8ca commit 1f8eae7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6308,7 +6308,7 @@ namespace ts {
63086308

63096309
// Parses out a JSDoc type expression.
63106310
export function parseJSDocTypeExpression(mayOmitBraces?: boolean): JSDocTypeExpression {
6311-
const result = <JSDocTypeExpression>createNode(SyntaxKind.JSDocTypeExpression, scanner.getTokenPos());
6311+
const result = <JSDocTypeExpression>createNode(SyntaxKind.JSDocTypeExpression);
63126312

63136313
const hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(SyntaxKind.OpenBraceToken);
63146314
result.type = doInsideOfContext(NodeFlags.JSDoc, parseJSDocType);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
// @allowJs: true
4+
// @noLib: true
5+
6+
// @Filename: /a.js
7+
/////** @type/**/ */
8+
////const x = 0;
9+
10+
goTo.marker();
11+
verify.quickInfoIs("");
12+
edit.insert(" ");
13+
verify.quickInfoIs("");

0 commit comments

Comments
 (0)