feat: resolve references by path across languages

Open
#249 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go, kotlin, ruby
Domain
backend

Research direction

Start with the UnresolvedRef struct in internal/indexer/goextract/types.go near line 118, then compare it with the emitters in kotlinextract.go:146 and rubyextract.go:148 to see the shared shape. The open question is whether path resolution uses one Addressing kind or one per target, and that design choice comes before any code. Done means path-named references get edges in callers, callees and impact output while unmatched paths stay unresolved and no existing field changes.

Written by the indexing model from the issue text.

Description

area:indexer enhancement priority:low
What exists today?

The Go extractor emits unresolved references as UnresolvedRef in internal/indexer/goextract/types.go:118. The struct has Name, PkgAlias and Kind, and no field for a path.

How does it behave now?

Every language extractor emits the same UnresolvedRef with Name and PkgAlias only. Examples: internal/indexer/mainstream/kotlinextract/kotlinextract.go:146 and internal/indexer/mainstream/rubyextract/rubyextract.go:148.

A string that names a file, a route, a template or a config key has no path field. The index has no way to link it to the file that defines it.

The Addressing field named in the follow-up to #198 is not in the tree at 834d3247. rg -n Addressing returns no match.

How should it behave?

An unresolved reference that names a path resolves to the file that defines it. For example, a Go call that loads templates/user.html links to that template file.

A path that matches no file stays unresolved, as it does today.

Whether one Addressing value covers route handlers, templates and config keys, or each one gets its own kind, is open.

What kind of improvement?

Other: cross-language edges that the index misses today.

Would this change existing behavior?

Yes. Path-named references gain new edges in callers, callees and impact output. Agents consume these shapes. The new edges must be additive. No field can be renamed or removed.

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

Related: #198. Its index-invariants change proposal is on branch feat/198-index-invariants.

Dominant language
Go
Stars
0
Forks
0
Avg merge
5h 16m
Merged PRs (30d)
107

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from seanb4t/codegraph-go

All issues in seanb4t/codegraph-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.