Introducing stack graphs
Blog post from GitHub
GitHub has announced the general availability of precise code navigation for all Python repositories, both public and private, on its platform, leveraging a new open-source framework called stack graphs. This framework enables the definition of name binding rules for programming languages using a declarative, domain-specific language, allowing for code navigation without requiring configuration from repository owners or integration with build processes. Stack graphs allow the extraction of information about definitions and references in code, facilitating features like "jump to definition" and "find all references." They address the complexity of different programming languages' name binding rules and the challenge of handling code changes across large, multi-file projects. By utilizing the Tree-sitter parsing framework, GitHub can create stack graphs incrementally, supporting a wide range of languages while maintaining scalability. This approach allows GitHub to provide automatic and dynamic code navigation features without manual setup, even accommodating the vast and diverse codebase hosted on its platform.