JSDocTypeLiteral.jsdocPropertyTags returns only the first tag
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- typescript
调研方向
Start with the JSDocPropertyTags definition in tools/scripts/tsc/ast.json and the getter generation in tools/scripts/tsc/generate-encoder.ts; the issue links a related report, #64864. Trace how raw child arrays are encoded and how generated getters handle list properties. Done when jsdocPropertyTags exposes all three tags as a node list while child traversal remains correct; an open pull request is already linked.
由索引模型根据 Issue 内容生成。
描述
🔎 Search Terms
jsdocPropertyTags, JSDocTypeLiteral, JSDocPropertyTag, typedef property, native API, sync API, NodeList
🕗 Version & Regression Information
This is the behavior in every v7 version I tried: 7.0.2 (typescript/unstable/*), 7.1.0-beta, and 7.1.0-dev.20261021.1. In 6.0, jsDocPropertyTags holds all the tags.
⏯ Playground Link
No response
💻 Code
import {API} from 'typescript/sync';
import {createFileSystem} from 'typescript/fs';
const api = new API({cwd: '/'});
const snapshot = api.createSnapshot({
openProjects: ['/tsconfig.json'],
fileSystem: createFileSystem([
['/tsconfig.json', JSON.stringify({files: ['/input.js'], compilerOptions: {allowJs: true, noLib: true}})],
['/input.js', `/**
* @typedef {Object} Events
* @property {string} a
* @property {string} b
* @property {string} c
*/
export const x = 1;`],
]),
});
const sourceFile = snapshot.getProjects()[0].program.getSourceFile('/input.js');
const literal = sourceFile.statements[0].jsDoc[0].tags[0].typeExpression;
console.log(literal.jsdocPropertyTags.length, literal.jsdocPropertyTags.name?.text);
const walked = [];
literal.forEachChild(node => { walked.push(node.name.text); });
console.log(walked);
api.close();
🙁 Actual behavior
undefined a
[ 'a', 'b', 'c' ]
jsdocPropertyTags is the first JSDocPropertyTag node, not a list. forEachChild still visits all three tags.
🙂 Expected behavior
jsdocPropertyTags is a node list containing all three tags, as jsDocPropertyTags is in 6.0.
Additional information about the issue
JSDocPropertyTags is a raw []*Node in tools/scripts/tsc/ast.json ("list": "raw"), so the encoder writes the tags as direct children of the node, with no NodeList entry. generateTSNodeGenerated in tools/scripts/tsc/generate-encoder.ts only treats nodeList and modifierList as lists, so this property gets a single-node getter that returns child 0.
Possibly related: #64864.
- 主要语言
- Go
- 星标
- 112k
- 派生
- 15.4k
- 平均合并
- 3 天 1 小时
- 30 天内合并 PR
- 136
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/TypeScript 的其他 Issue
-
Won't Fix
难度 2/5 1-3 小时 新手友好度 62/100
microsoft/TypeScript#65107 · 1 条评论 ·
维护者通常 1 天内回复
-
Native API: formatDiagnosticsWithColorAndContext drops related information without a file location可能已有人在做 @timurzvural 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
microsoft/TypeScript#65087 ·
维护者通常 1 天内回复
-
TS7 LSP: documentHighlight returns nothing when the file path contains '@'可能重新可做 关联的 PR 已关闭且未合并。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/TypeScript#64758 ·
维护者通常 1 天内回复
-
Language server (tsc --lsp) exits with code 1 after `shutdown` and `exit`可能已有人在做 @rajnish-verma-22172 于 13 天前认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/TypeScript#64742 · 1 条评论 ·
维护者通常 1 天内回复
-
Class names `eval` and `arguments` are not reported as invalid strict mode bindings可能已有人在做 @dmety 于 26 天前认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/TypeScript#64661 ·
维护者通常 1 天内回复
查看 microsoft/TypeScript 的全部 Issue
相似的 Issue
-
area: frontend priority: normal
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
TestAutonomousStop_ReportsObservedState fails under host load: 1s wall-clock ceiling vs 250ms cycle未关闭type:bug
难度 2/5 1-3 小时 新手友好度 65/100
nightgauge/nightgauge#2909 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
jasonfen/terminal-space-program#842 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 78/100
MustacheCase/zanadir#521 ·
维护者通常 1 天内回复
-
v3.1.0: spread placement groups fail — label key uses the reserved hetzner.cloud prefix可能已有人在做 @ScrimReaper 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
stubbi/karpenter-provider-hetzner#120 ·
维护者通常 4 天内回复