opencode-for-rust
v0.1.0-next.1
Published
OpenCode plugin for Rust
Readme
opencode-for-rust
OpenCode plugin for Rust
Note: This plugin is designed to work with OpenCode.
Features
- 🦀 Automatic Type Injection: Automatically analyzes Rust files and injects relevant type definitions (structs, enums, traits) into the context when you read a file.
- 🔍 Type Lookup: Includes a
lookup_typetool to find specific Rust type definitions by name. - 📋 Type Listing: Includes a
list_typestool to see all available Rust types in the project. - ⚡ Tree-Sitter Powered: Uses
tree-sitter-rustfor robust and fast code analysis. - 🔧 Zero Configuration: Works out of the box for standard Rust projects.
Tools
lookup_type
Find a Rust type definition by name.
- name: The name of the type to find (e.g.,
MyStruct).
list_types
List all available Rust type names in the project.
Development
Prerequisites
Scripts
mise run build- Build the pluginmise run test- Run testsmise run lint- Lint codemise run lint:fix- Fix linting issuesmise run format- Format code
Installation
Add this plugin to your OpenCode configuration (~/.config/opencode/config.json):
{
"plugins": ["opencode-for-rust"]
}Repository
https://github.com/opencode/opencode-for-rust
License
MIT
