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
- 平均合併
- 2 天 21 小時
- 30 天內合併 PR
- 126
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/TypeScript 的其他 Issue
-
Native API: formatDiagnosticsWithColorAndContext drops related information without a file location未關閉
難度 2/5 1-3 小時 新手友好度 75/100
microsoft/TypeScript#65087 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
microsoft/TypeScript#65083 ·
維護者通常 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 於 12 天前認領。 未關閉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 於 25 天前認領。 未關閉Bug
難度 2/5 1-3 小時 新手友好度 68/100
microsoft/TypeScript#64661 ·
維護者通常 1 天內回覆
查看 microsoft/TypeScript 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
router-for-me/CLIProxyAPI#7209 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
Azure/azure-storage-azcopy#3674 ·
維護者通常 1 天內回覆
-
date_time, url_encode, html_escape, to_unix_time, contains_all and contains_any panic when called without arguments可能已有人在做 @antcybersec 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
projectdiscovery/dsl#372 ·
維護者通常 1 天內回覆
-
blocked-needs-validation
難度 2/5 1-3 小時 新手友好度 62/100
projectcapsule/capsule#2265 ·
維護者通常 1 天內回覆
-
Remove "Model catalog refresh unavailable" warning from OpenRouter agent runs可能已有人在做 @superplanehq-integration 今天認領。 未關閉superplane
難度 2/5 1-3 小時 新手友好度 75/100
superplanehq/superplane#9164 ·
維護者通常 1 天內回覆