Stackwalk
Universal language-agnostic AST walking and accurate call stack generation with tree-sitter.
Install / Use
/learn @winfunc/StackwalkREADME
stackwalk 🌟
StackWalk is a library for parsing and indexing code in various languages. 📚
Table of Contents
Features
- Extract code structure and call information 📊
- Generate call graphs 🌐
- Support for multiple languages 🌍
- Rust 🦀
- Python 🐍
- Configurable language-specific settings 🛠️
Installation
Add stackwalk as a dependency in your Cargo.toml file:
[dependencies]
stackwalk = "0.1.0"
Usage
use stackwalk::config::Config;
use stackwalk::indexer::index_directory;
fn main() {
let toml_str = fs::read_to_string("stackwalk.toml").expect("Unable to read file");
let config = Config::from_toml(&toml_str).unwrap();
let dir_path = "path/to/directory";
let (blocks, call_stack, call_graph) = index_directory(&config, dir_path);
// Process the extracted information
// ...
}
Configuration
StackWalk uses a TOML configuration file to specify language-specific settings. Here's an example configuration:
[languages]
[languages.python]
[languages.python.matchers]
import_statement = "import_from_statement"
# ...
[languages.rust]
[languages.rust.matchers]
import_statement = "use_declaration"
# ...
Development
To build the project from source:
$ git clone https://github.com/stitionai/stackwalk.git
$ cd stackwalk/
$ cargo build --release
Contribution
Ways to contribute:
- Suggest a feature
- Report a bug
- Fix something and open a pull request
- Help document the code
- Spread the word
License
Licensed under the MIT License, see <a href="https://github.com/stitionai/stackwalk/blob/master/LICENSE">LICENSE</a> for more information.
Liked the project?
Support the project by starring the repository. ⭐
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
