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

オープン 初心者向け
#3,223 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp, nodejs
領域
devtools

調査の方向性

失敗する正規表現は lib/dist/resolution/name-matcher.js の 10334 行付近にある cppParenListAfter で構築されており、new RegExp の前に ~ だけがエスケープされています。ソースに #2769 の修正がすでに含まれているか確認し、そのうえで演算子名の正規表現メタ文字をすべてエスケープしてください(例:+)。operator++ を含む C++ ファイルで、'Nothing to repeat' エラーを出さずに参照解決が 14% を超えれば完了です。

索引モデルが 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分
マージ済み PR(30日)
528

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

colbymchenry/codegraph のほかの issue

colbymchenry/codegraph の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。