feat: resolve Rust use declarations for cross-module and cross-crate calls

Aperta
#344 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, rust

Direzione di ricerca

Start from docs/LANGUAGE-CAPABILITY-MATRIX.md line 176 and the Rust indexer code that extracts use declarations as dependency references; trace how module keys are computed at extract time and where the enclosing crate name is missing. Compare the same-file and same-computed-module-path resolution paths to see what a use-imported call needs. Confirm in openspec/specs/ that the deliberate-gap decision still holds, then add cross-module and cross-crate resolution plus tests for callers, callees, and impact.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:indexer enhancement needs-triage
What exists today?

The Rust indexer's handling of use declarations, which feeds call resolution.

How does it behave now?

use declarations are extracted as dependency references but never populate Imports (docs/LANGUAGE-CAPABILITY-MATRIX.md, line 176). A call through a use-imported name does not resolve across modules or crates. Only same-file and same-computed-module-path resolution succeeds.

The matrix gives the cause: the enclosing crate name is not available at extract time, so no matching module key is computed. The matrix also calls this gap deliberate. The maintainer must confirm whether that decision still holds.

The reporter did not attach command output.

How should it behave?

A call to helper, imported with use crate::util::helper;, resolves to the helper definition in module util. A call through use other_crate::helper; resolves to that crate's definition. Trait method resolution through a use import will work the same way.

What kind of improvement?

Correctness in an edge case

Would this change existing behavior?

Yes. Calls through use imports gain call edges in Rust repositories, so the output of codegraph callers, codegraph callees and codegraph impact changes for those repositories.

Before submitting
  • I searched existing issues and this is not a duplicate
  • I verified that the current behavior is not a deliberate decision in openspec/specs/

🤖 Generated with Claude Code
https://claude.ai/code/session_0167Dcyr16pdkFTrCBgBTzoV

Lingua principale
Go
Stelle
0
Fork
0
Merge medio
7h 42m
PR unite (30g)
111

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di seanb4t/codegraph-go

Tutte le issue di seanb4t/codegraph-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.