A Zed editor extension providing comprehensive language support for StoneScript, the scripting language used in Stone Story RPG.
- Syntax Highlighting - Rich syntax highlighting powered by Tree-sitter
- Language Server Integration - Full LSP support with StoneScript Language Server
- Code Completion - Intelligent autocomplete for game objects, abilities, and functions
- Diagnostics - Real-time error detection and warnings
- Hover Documentation - Inline documentation for built-in functions and objects
- Go to Definition - Navigate to variable and function declarations
- Code Formatting - Automatic code formatting support
- Open Zed editor
- Open the command palette (
Cmd+Shift+Pon macOS,Ctrl+Shift+Pon Linux/Windows) - Search for "zed: extensions"
- Search for "StoneScript"
- Click "Install"
The extension will automatically download and install the StoneScript Language Server on first use.
git clone https://github.com/kurbezz/zed-stonescript.git
cd zed-stonescriptThen in Zed, use zed: install dev extension and select this directory.
The extension automatically manages the StoneScript Language Server:
- Automatic Installation: The LSP binary is downloaded automatically from GitHub releases when you first open a StoneScript file
- Version Management: The extension checks for updates and downloads new versions as needed
- Platform Support: Pre-built binaries for macOS (Apple Silicon & Intel), Linux (x86_64), and Windows
If you prefer to use a custom-built LSP server, you can install it manually and add it to your PATH:
git clone https://github.com/kurbezz/stonescript-language-server.git
cd stonescript-language-server
cargo build --release
# Add target/release/stonescript-lsp to your PATHThe extension will automatically detect and use the LSP from your PATH if available.
The extension automatically activates for files with the following extensions:
.ss- StoneScript files (primary extension).txt- Text files (now supported for StoneScript code)
The extension uses the Tree-sitter grammar from tree-sitter-stonescript.
Configuration is managed through extension.toml:
id = "stonescript"
name = "StoneScript"
version = "0.3.0"
description = "StoneScript language support with LSP"
icon = "icons/stonescript.svg"The extension provides semantic syntax highlighting for:
- Keywords (
var,if,else,for,while, etc.) - Built-in objects (
foe,item,armor,loc, etc.) - Functions and function calls
- Variables and constants
- Operators
- String and number literals
- Comments
When the StoneScript Language Server is installed, you get:
-
Intelligent Code Completion - Context-aware suggestions for:
- Variables and functions
- Built-in game objects
- Abilities (dash, smite, bardiche, etc.)
- Locations (Rocky Plateau, Deadwood Canyon, etc.)
- Foes (Poena, Nagaraja, Bolesh, etc.)
- UI elements, sounds, and music
-
Real-time Diagnostics - Immediate feedback on:
- Syntax errors
- Undefined variables
- Type mismatches
-
Hover Information - Documentation on hover for:
- Built-in functions
- Game objects and properties
- Variables and their inferred types
-
Go to Definition - Jump to declarations of:
- Variables
- Functions
- Custom definitions
This extension is written in Rust. To build:
cargo build --releasezed-stonescript/
├── extension.toml # Extension metadata
├── Cargo.toml # Rust dependencies
├── icons/
│ ├── stonescript.svg # Extension icon
│ └── README.md # Icon customization guide
├── src/
│ └── lib.rs # Extension implementation
└── languages/
└── stonescript/
├── config.toml # Language configuration
└── highlights.scm # Syntax highlighting queries
The extension includes a custom icon that appears in Zed's extension list and file tree. To customize it:
- Edit or replace
icons/stonescript.svgwith your own SVG icon (recommended size: 64x64px) - Update the
iconfield inextension.tomlif you change the filename - Rebuild the extension with
cargo build --release
See icons/README.md for detailed guidelines on creating or modifying icons.
The syntax highlighting is defined in languages/stonescript/highlights.scm using Tree-sitter query syntax.
Contributions are welcome! Please feel free to submit a Pull Request.
- Improved syntax highlighting patterns
- Additional language server features
- Better documentation and examples
- Bug fixes and performance improvements
MIT License - see LICENSE file for details
- stonescript-language-server - LSP implementation for StoneScript
- tree-sitter-stonescript - Tree-sitter grammar for StoneScript
Built for the Stone Story RPG community with tools from:
- Zed Industries - The Zed editor
- Tree-sitter - Incremental parsing library
- tower-lsp - LSP framework
For issues, questions, or suggestions:
- Open an issue on GitHub
- Visit the Stone Story RPG community