Published v1.6.2 still fails to index C++ operator++ references on Windows (related to #2482 / #2769)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
失败的正则表达式在 lib/dist/resolution/name-matcher.js 约第 10334 行的 cppParenListAfter 中构建,其中在 new RegExp 之前只转义了 ~。请检查源码是否已包含 #2769 的修复,然后转义运算符名称中的所有正则元字符,例如 +。当包含 operator++ 的 C++ 文件的引用解析超过 14%,且不再出现 'Nothing to repeat' 错误时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Summary
CodeGraph 1.6.2 fails during reference resolution with an invalid regular expression involving operator++. This prevents my project from being fully indexed.
I found #2482 and the fix merged in #2769. My installed npm package still contains the unescaped operator-name handling. Could you confirm which published release includes the fix, or recommend a supported workaround until it is released?
Environment
- OS: Windows, x64
- Shell: PowerShell
- Package:
@colbymchenry/codegraph - Installed version: 1.6.2
- Installation:
npm install -g @colbymchenry/codegraph - System Node.js: v26.13.0
- CodeGraph's bundled Node.js: v24.16.0
The MCP server connects successfully through Magpie. The indexing failure also happens directly in the CLI, independently of MCP calls.
Steps to reproduce on my project
- Install the npm package.
- Open PowerShell in the project root.
- Run:
codegraph.cmd init - Scanning finds 41,050 files.
- Parsing completes, but reference resolution fails at approximately 14%.
- Running
codegraph.cmd indexalso fails with the same regex error.
Actual output
Initialized in <project-root>
Scanning files — 41,050 found
Parsing code — done
Resolving refs — 14%
Failed: Invalid regular expression: /\boperator++\s*(?:<[^<>()]*>)?\s*\(/: Nothing to repeat
Re-indexing reports:
Failed to index: Invalid regular expression: /\boperator++\s*(?:<[^<>()]*>)?\s*\(/: Nothing to repeat
After the failed initialization, running init again says:
Already initialized in <project-root>
Use "codegraph index" to re-index or "codegraph sync" to update
This message does not make it clear that the initial indexing did not finish.
Expected behavior
- Operator names containing regex metacharacters should not crash reference resolution.
- Indexing should complete for supported source files.
- A failed initial index should be clearly distinguishable from a successfully indexed project.
Relevant installed code
In the installed Windows platform package:
lib/dist/resolution/name-matcher.js, line 10334, inside cppParenListAfter:
const at = new RegExp(`\\b${name.replace(/[~]/g, '\\$&')}\\s*(?:<[^<>()]*>)?\\s*\\(`).exec(text.slice(column));
This escapes ~ only, leaving the + characters in operator++ unescaped.
Impact
This blocks CodeGraph indexing for my project. An incomplete index is left behind, so I cannot rely on it for complete code relationships.
Related: #2482, #2457, #2769.
- 主要语言
- C
- 星标
- 73.2k
- 派生
- 4.7k
- 平均合并
- 3 小时 39 分钟
- 30 天内合并 PR
- 528
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
colbymchenry/codegraph 的其他 Issue
-
A `../` entry in package.json `workspaces` makes a folder outside the project count as a workspace package, and a call gets linked to the wrong function可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
colbymchenry/codegraph#3093 ·
维护者通常 1 天内回复
-
Windows: npm-shim spawnSync missing windowsHide flashes a console window on every MCP server launch未关闭
难度 2/5 1-3 小时 新手友好度 86/100
colbymchenry/codegraph#3054 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
colbymchenry/codegraph#2974 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
colbymchenry/codegraph#2959 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
colbymchenry/codegraph#1900 · 2 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
查看 colbymchenry/codegraph 的全部 Issue
相似的 Issue
-
难度 2/5 半天 新手友好度 72/100
vercel-labs/scriptc#2910 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
darktable-org/darktable#22939 ·
维护者通常 1 天内回复
-
os: input_password leaves terminal echo disabled when reading fails可能已有人在做 @davlgd 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
armv7l: `close`, `unlink` and `chroot` pass the kernel their argument's address可能已有人在做 @aoinoikaz 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 70/100
arduino/ArduinoCore-megaavr#152 ·