Skip to content

Investigate using tree-sitter-stack-graphs for name resolution #10

@begleynk

Description

@begleynk

I posted Dossier on the Rust subreddit, and user grunzl very helpfully pointed out that we could consider using https://github.com/github/stack-graphs and its tree-sitter integration for name resolution instead of rolling our own.

In short, stack graphs create a graph of symbols and their scopes, which you can then probe to resolve names to their definitions (aka "jump to definition"). You have to write a similar DSL to tree sitter queries to describe the rules for each language, and you can then use stack graphs to resolve names even across imports.

This is the technology that apparently powers GitHub's code navigation.

Definitely worth exploring, since relying on existing research/tooling in this area would be much preferred to rolling our own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions