mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-20 19:45:07 -06:00
Expand span of @typedef with properties to include the @typedef tag (#25950)
This commit is contained in:
parent
2b14bcbb56
commit
5e94cf626b
@ -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);
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
},
|
||||
"typeExpression": {
|
||||
"kind": "JSDocTypeLiteral",
|
||||
"pos": 28,
|
||||
"pos": 8,
|
||||
"end": 100,
|
||||
"jsDocPropertyTags": [
|
||||
{
|
||||
|
||||
14
tests/cases/fourslash/goToTypeDefinition_typedef.ts
Normal file
14
tests/cases/fourslash/goToTypeDefinition_typedef.ts
Normal 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");
|
||||
Loading…
x
Reference in New Issue
Block a user