Rust: field_type_hint binds a call by its receiver variable name, ignoring the declared type (`source: &Series` → `Source::key` at 0.85)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
Start in src/pipeline/pass_parallel.c at try_field_type_hint and read the Rust and Go handling, then reproduce with the supplied 57-file Rust project and compare its parallel and sequential CALLS edges. The fix should prevent receiver variable names from creating high-confidence Rust call edges when the declared type differs; verify the two calls resolve consistently without the incorrect Source::key edge.
索引モデルが issue の本文から書いたものです。
説明
Version
v0.12.1 release binary, Linux (x64). The code path is unchanged on main @ cdfdf264.
What happened, and what did you expect?
On the parallel resolver (more than 50 files), a Rust method call whose receiver the LSP leaves untyped goes through try_field_type_hint (src/pipeline/pass_parallel.c). The hint capitalises the receiver's variable name and binds the candidate whose owning segment equals it, at 0.85. #1936 (for #1927) narrowed that from a substring to an owning-segment match, and Go is excluded (F-G9), but Rust still runs it. Segment equality still fires whenever a variable is named after an unrelated project type. The receiver's declared type is never read.
Expected: a variable name alone yields no CALLS edge, least of all at 0.85. source: &Series calls Series::key; source: extcrate::Bar calls the crate's Bar::key.
Reproduction
Cargo.toml ([dependencies] extcrate = "1", never built), src/lib.rs declaring the modules below, plus 55 one-line src/padN.rs files (pub fn padN() -> u32 { N }) to cross MIN_FILES_FOR_PARALLEL.
// src/series.rs
pub enum Series {
Bars(u32),
}
impl Series {
pub fn key(&self) -> u32 {
match self {
Self::Bars(n) => *n,
}
}
}
// src/source.rs
pub struct Source(pub u32);
impl Source {
pub fn key(&self) -> u32 {
self.0
}
}
// src/user.rs
use crate::series::Series;
use extcrate::Bar;
/// Declared `&Series`: calls Series::key. Must not bind Source::key.
pub fn declared_project_type(source: &Series) -> u32 {
source.key()
}
/// Declared external `Bar`: calls extcrate's Bar::key. Must not bind Source::key.
pub fn declared_external_type(source: Bar) -> u32 {
source.key()
}
codebase-memory-mcp cli index_repository '{"repo_path":"<repro>"}'
codebase-memory-mcp cli query_graph '{"project":"<p>","query":"MATCH (a)-[r:CALLS]->(b) WHERE b.name = \"key\" RETURN a.name, b.qualified_name, r.strategy, r.confidence"}'
| caller | parallel (57 files) | sequential (same repo without the pad files) |
|---|---|---|
declared_project_type |
src.source.Source.key, field_type_hint, 0.85 |
src.series.Series.key, suffix_match, 0.55 |
declared_external_type |
src.source.Source.key, field_type_hint, 0.85 |
src.series.Series.key, suffix_match, 0.55 |
Both parallel edges are wrong, and the hint turns a 0.55 guess into a 0.85 one. The two resolvers also diverge, which is what F-G9 removed for Go.
Two side notes. Neither edge is lsp_* in either resolver: the LSP leaves source: &Series untyped although Series comes in through use crate::series::Series. The sequential edge for declared_external_type is the external-receiver fallback, which I'm filing separately.
Possible fix: exclude Rust from try_field_type_hint as Go is.
- 主要言語
- C
- スター
- 45.8k
- フォーク
- 3.8k
- 平均マージ
- 2日 18時間
- マージ済み PR(30日)
- 108
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DeusData/codebase-memory-mcp のほかの issue
-
bug ux/behavior
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
DeusData/codebase-memory-mcp#3191 ·
メンテナーはふだん 1 日以内に返信
-
documentation enhancement parsing/quality ux/behavior
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
DeusData/codebase-memory-mcp#3131 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
hook-augment: the five-row cap keeps the first five search_graph rows, so variables and modules displace function definitions (v0.12.1)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug editor/integration parsing/quality ux/behavior
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DeusData/codebase-memory-mcp#3062 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug documentation editor/integration parsing/quality
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DeusData/codebase-memory-mcp#3050 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
editor/integration parsing/quality
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
DeusData/codebase-memory-mcp#2286 ·
メンテナーはふだん 1 日以内に返信
DeusData/codebase-memory-mcp の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
メンテナーはふだん 1 日以内に返信
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameオープンgame: 010065A014024000 ios
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
seedds/nxnative#3714 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信