Repository navigation
Closed
Description
Termdock Version | Termdock 版本
Latest (main branch) | 最新版 (主分支)
Platform | 平台
macOS (Apple Silicon - M1 ~ M5)
Bug Description | 錯誤描述
This might be caused by the following issues:
- Bug in Termdock's .gitignore parser: The repository's .gitignore uses [Oo]bj/ (a character class) to ignore the obj/ directory. However, Termdock's GitignoreParser.gitignorePatternToRegex() escapes [ and ] as literal characters. As a result, the converted regex never matches the actual obj/ path. Verified behavior:
regex: /(^|/)[Oo]bj(/.*)?$/ → match obj/ = false - Cascade failure & crash loop: Because obj/ is not excluded, the worker scans the build output directory and hits project.packagespec.json. This file begins with a UTF-8 BOM, causing JSON.parse to fail. The worker attempts a regex fallback but ends up crashing with Aborted(). Upon restarting and re-initializing, the worker scans the exact same file and crashes again—triggering an infinite crash loop, which leaves indexSize: 0 and lastUpdate: 1970.
Steps to Reproduce | 重現步驟
- use code analysis.home.buildindex
Expected Behavior | 預期行為
No response
Screenshots | 螢幕截圖
No response
Logs | 日誌
{"timestamp":"2026-08-21T02:06:28.386Z","level":"error","message":"[ASTWorker:stderr] 🔍 [loadLanguageParser] Loading parser for language: c_sharp","source":"main-process"}
{"timestamp":"2026-08-21T02:06:29.675Z","level":"error","message":"[ASTWorker:stderr] 🔍 [loadLanguageParser] Loading parser for language: c_sharp","source":"main-process"}
{"timestamp":"2026-08-21T02:06:29.675Z","level":"error","message":"[ASTWorker:stderr] 🔍 [loadLanguageParser] Loading parser for language: c_sharp","source":"main-process"}
{"timestamp":"2026-08-21T02:06:30.037Z","level":"error","message":"[ASTWorker:stderr] Invalid JSON in /project/obj/local/project.packagespec.json, extracting keys with regex","source":"main-process"}
{"timestamp":"2026-08-21T02:06:38.453Z","level":"error","message":"[ASTWorker:stderr] Aborted()","source":"main-process"}
{"timestamp":"2026-08-21T02:06:39.511Z","level":"error","message":"[ASTWorkerManager] TIMEOUT ast_4_1787277699512","source":"main-process"}Additional Context | 額外資訊
No response
Activity
cyh7789 commentedon Aug 21, 2026
Thanks for the report, and for the diagnosis. Your first point is exactly right and we reproduced it.
Confirmed: the gitignore character class bug.
GitignoreParser.gitignorePatternToRegex()escapes[and]unconditionally, so[Oo]bj/compiles to/(^|\/)\[Oo\]bj(\/.*)?$/and only matches a directory literally named[Oo]bj. Sinceobjis also not in the hardcoded fallback list, nothing else catches it. This breaks every.gitignorethat uses character classes:[Bb]in/,[Dd]ebug/, and the rest of the Visual Studio template. Not fixed yet, and scheduled for 1.20.The crash chain is already fixed on the development branch, but not in any release you can install yet. You are on 1.19.0, which is the current public release and does not contain these changes. They will ship in 1.20. Three separate changes each break a link in the chain you hit:
Invalid JSON in ..., extracting keys with regexno longer exists in the current code.One correction to your second point: the regex fallback is plain JS string handling and cannot produce
Aborted(). That message comes from the tree-sitter WASM runtime. The two were adjacent in the log, not causally linked. It does not change the outcome, since the JSON path is gone either way.Also worth knowing: there is no
tree-sitter-c_sharp.wasmshipped, so C# files currently produce no symbols at all. Indexing a C# project will not crash once the above lands, but it will not give you much either until we add that grammar.Workaround until 1.20: add a plain
obj/line (no character class) to.gitignore. That keeps the build output out of the scan, which removes the trigger for the crash loop on 1.19.0 as well.