Export status is answered in three places, two of them hand-mirrored regexes
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, rust, typescript
- 領域
- devtools
調査の方向性
Read the TypeScript and JavaScript extraction entry points at src/extraction/languages/typescript.ts:110-116 and javascript.ts:68, then compare src/extraction/tree-sitter.ts:2368, 2843 with codegraph-kernel/src/tsjs/extractors.rs:301 and the resolver change in #1720. The issue calls for export status to cover the listed ES and CommonJS forms and for the resolver's per-file fact to derive from it. Done should include corpus measurement; no specific test file is named.
索引モデルが issue の本文から書いたものです。
説明
Three places in the codebase answer "is this name exported from this file", none of them shares an implementation, and they disagree about what counts.
isExported — the AST one. src/extraction/languages/typescript.ts:110-116 and javascript.ts:68 walk the parent chain for an export_statement ancestor. That is exact for export function f, and blind to everything else: const x = …; export { x } and every CommonJS form (module.exports, exports.x, exports["x"]) leave isExported false on the declaration's node.
isExportedLater — a regex, written because of that blindness. src/extraction/tree-sitter.ts:2368 runs one anchored regex over the file source for export default NAME / export { NAME }, and codegraph-kernel/src/tsjs/extractors.rs:301 mirrors it in Rust — two implementations that must be kept in step by hand, with only a doc comment saying so. Its single call site is the store-extraction condition at tree-sitter.ts:2843, so the fix it represents is scoped to Zustand stores rather than available generally.
A third, per-file, in the resolver. #1720 needs "does this file export anything at all" and cannot use either of the above — isExported would answer no for a CommonJS module, and isExportedLater answers a per-name question, not a per-file one. So it adds another source regex.
The result is that a CommonJS module's exports are invisible to the graph as exports, export { x } is visible only to store extraction, and the resolver re-derives a coarser version of the same fact from the same file text. Each site is individually defensible; together they mean the question has no single answer to point at, and the two regexes drift independently across a language boundary.
Worth considering: compute export status once during extraction — covering the export_statement ancestor, later export { … } / export default, and the CommonJS forms — and persist it on the node, with the per-file "exports nothing" fact derived from it. That would let #1720's guard read a stored fact instead of the file text, make CommonJS exports visible generally, and leave one implementation per language rather than two hand-mirrored regexes plus an AST walk.
Raising it as an issue rather than a PR because it touches extraction, the kernel and the resolver at once, changes what is persisted, and would want to be measured on a corpus the way the resolution changes have been — not something to fold into a PR already under review.
- 主要言語
- C
- スター
- 73.2k
- フォーク
- 4.7k
- 平均マージ
- 13時間 27分
- マージ済み PR(30日)
- 518
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
colbymchenry/codegraph のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
colbymchenry/codegraph#2634 ·
メンテナーはふだん 1 日以内に返信
-
Windows: bundled Node v24.16.0 can abort at exit (nodejs/node#56645); please bundle Node >= 24.20.0対応中かも @Ancienttwo が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
colbymchenry/codegraph#2617 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 72/100
colbymchenry/codegraph#2482 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
colbymchenry/codegraph#1900 · コメント 2 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
colbymchenry/codegraph#1700 ·
メンテナーはふだん 1 日以内に返信
colbymchenry/codegraph の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
interpreter-core type-feature
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
category:port-update
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
Update OpenBSD CI to OpenBSD 8.0 and vmactions/openbsd-vm v1.4.9対応中かも @hyoklee が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信