Skip to content

Commit

Permalink
Fix bug: Ensure JSDoc type range is valid (#27343)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy committed Oct 9, 2018
1 parent dd9b8ca commit f6ca105
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6308,7 +6308,7 @@ namespace ts {

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

const hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(SyntaxKind.OpenBraceToken);
result.type = doInsideOfContext(NodeFlags.JSDoc, parseJSDocType);
Expand Down
13 changes: 13 additions & 0 deletions tests/cases/fourslash/editJsdocType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/// <reference path='fourslash.ts' />

// @allowJs: true
// @noLib: true

// @Filename: /a.js
/////** @type/**/ */
////const x = 0;

goTo.marker();
verify.quickInfoIs("");
edit.insert(" ");
verify.quickInfoIs("");

0 comments on commit f6ca105

Please sign in to comment.