opencode-for-rust 0.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/index.js +19145 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 zenobi.us
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# opencode-for-rust
|
|
2
|
+
|
|
3
|
+
OpenCode plugin for Rust
|
|
4
|
+
|
|
5
|
+
> **Note**: This plugin is designed to work with [OpenCode](https://opencode.ai).
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- 🦀 **Automatic Type Injection**: Automatically analyzes Rust files and injects relevant type definitions (structs, enums, traits) into the context when you read a file.
|
|
10
|
+
- 🔍 **Type Lookup**: Includes a `lookup_type` tool to find specific Rust type definitions by name.
|
|
11
|
+
- 📋 **Type Listing**: Includes a `list_types` tool to see all available Rust types in the project.
|
|
12
|
+
- ⚡ **Tree-Sitter Powered**: Uses `tree-sitter-rust` for robust and fast code analysis.
|
|
13
|
+
- 🔧 **Zero Configuration**: Works out of the box for standard Rust projects.
|
|
14
|
+
|
|
15
|
+
## Tools
|
|
16
|
+
|
|
17
|
+
### `lookup_type`
|
|
18
|
+
|
|
19
|
+
Find a Rust type definition by name.
|
|
20
|
+
|
|
21
|
+
- **name**: The name of the type to find (e.g., `MyStruct`).
|
|
22
|
+
|
|
23
|
+
### `list_types`
|
|
24
|
+
|
|
25
|
+
List all available Rust type names in the project.
|
|
26
|
+
|
|
27
|
+
## Development
|
|
28
|
+
|
|
29
|
+
### Prerequisites
|
|
30
|
+
|
|
31
|
+
- [Bun](https://bun.sh)
|
|
32
|
+
- [Mise](https://mise.jdx.dev) (optional)
|
|
33
|
+
|
|
34
|
+
### Scripts
|
|
35
|
+
|
|
36
|
+
- `mise run build` - Build the plugin
|
|
37
|
+
- `mise run test` - Run tests
|
|
38
|
+
- `mise run lint` - Lint code
|
|
39
|
+
- `mise run lint:fix` - Fix linting issues
|
|
40
|
+
- `mise run format` - Format code
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
Add this plugin to your OpenCode configuration (`~/.config/opencode/config.json`):
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"plugins": ["opencode-for-rust"]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Repository
|
|
53
|
+
|
|
54
|
+
https://github.com/opencode/opencode-for-rust
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
MIT
|