Expand span of @typedef with properties to include the @typedef tag (#25950)

This commit is contained in:
Andy 2018-07-26 08:56:24 -07:00 committed by GitHub
parent 2b14bcbb56
commit 5e94cf626b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 2 deletions

View File

@ -6835,7 +6835,7 @@ namespace ts {
let child: JSDocTypeTag | JSDocPropertyTag | false;
let jsdocTypeLiteral: JSDocTypeLiteral | undefined;
let childTypeTag: JSDocTypeTag | undefined;
const start = scanner.getStartPos();
const start = atToken.pos;
while (child = tryParse(() => parseChildPropertyTag())) {
if (!jsdocTypeLiteral) {
jsdocTypeLiteral = <JSDocTypeLiteral>createNode(SyntaxKind.JSDocTypeLiteral, start);

View File

@ -32,7 +32,7 @@
},
"typeExpression": {
"kind": "JSDocTypeLiteral",
"pos": 28,
"pos": 8,
"end": 100,
"jsDocPropertyTags": [
{

View File

@ -0,0 +1,14 @@
/// <reference path='fourslash.ts' />
// @allowJs: true
// @Filename: /a.js
/////**
//// * /*def*/@typedef {object} I
//// * @property {number} x
//// */
////
/////** @type {I} */
////const /*ref*/i = { x: 0 };
verify.goToType("ref", "def");