Published v1.6.2 still fails to index C++ operator++ references on Windows (related to #2482 / #2769)

未关闭 适合新手
#3,223 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp, nodejs
领域
devtools

调研方向

失败的正则表达式在 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

  1. Install the npm package.
  2. Open PowerShell in the project root.
  3. Run:
    codegraph.cmd init
    
  4. Scanning finds 41,050 files.
  5. Parsing completes, but reference resolution fails at approximately 14%.
  6. Running codegraph.cmd index also 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

colbymchenry/codegraph 的其他 Issue

查看 colbymchenry/codegraph 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。