JSDocTypeLiteral.jsdocPropertyTags returns only the first tag
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🔎 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.
- Ngôn ngữ chính
- Go
- Star
- 112k
- Fork
- 15.4k
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 126
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/TypeScript
-
Native API: formatDiagnosticsWithColorAndContext drops related information without a file locationĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/TypeScript#65087 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
API: `tsc.exe` opens a visible console window on Windows when the parent process has no consoleĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/TypeScript#65083 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TS7 LSP: documentHighlight returns nothing when the file path contains '@'Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/TypeScript#64758 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Language server (tsc --lsp) exits with code 1 after `shutdown` and `exit`Có thể đã có người làm @rajnish-verma-22172 đã nhận 12 ngày trước. Đang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/TypeScript#64742 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Class names `eval` and `arguments` are not reported as invalid strict mode bindingsCó thể đã có người làm @dmety đã nhận 25 ngày trước. Đang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/TypeScript#64661 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/TypeScript
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
router-for-me/CLIProxyAPI#7209 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Azure/azure-storage-azcopy#3674 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
date_time, url_encode, html_escape, to_unix_time, contains_all and contains_any panic when called without argumentsCó thể đã có người làm @antcybersec đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
projectdiscovery/dsl#372 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
blocked-needs-validation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
projectcapsule/capsule#2265 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Remove "Model catalog refresh unavailable" warning from OpenRouter agent runsCó thể đã có người làm @superplanehq-integration đã nhận hôm nay. Đang mởsuperplane
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
superplanehq/superplane#9164 ·
Maintainer thường phản hồi trong vòng 1 ngày