Spring RS

Language Server Protocol support and application management for the spring-rs framework.
Features
🚀 Application Management
- Auto-detect spring-rs applications in your workspace
- Run/Debug applications with one click
- Profile support - easily switch between development, production, and custom profiles
- Port detection - automatically detect and display application ports
- Open in browser - quickly open running applications
- Batch operations - run or stop multiple applications at once
🔍 Real-time Application Insights
When your application is running, get instant visibility into:
- Components - view all registered components and their dependencies
- Routes - browse all HTTP endpoints with methods and paths
- Jobs - see scheduled tasks and cron expressions
- Plugins - inspect loaded plugins and their configurations
📊 Dependency Graph Visualization
Visualize component dependencies with an interactive graph powered by D3.js:
- Click nodes to navigate to component definitions
- Identify circular dependencies
- Understand your application architecture at a glance
🎯 Smart TOML Configuration Support
- Intelligent completion for
config/app.toml files
- Schema validation based on spring-rs configuration metadata
- Environment variable interpolation support (
${VAR:default})
- Jump to definition from configuration to Rust code
🛠️ Code Navigation
- Navigate from routes to handler functions
- Jump from components to their definitions
- Show component dependencies
- Quick access to documentation
Installation
Prerequisites
- Visual Studio Code 1.75.0 or higher
- Rust toolchain (rustc, cargo)
- spring-lsp language server (optional, bundled with extension)
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Spring RS"
- Click Install
From VSIX
- Download the latest
.vsix file from Releases
- Open VS Code
- Go to Extensions
- Click "..." menu → "Install from VSIX..."
- Select the downloaded file
Getting Started
1. Create a spring-rs Project
cargo new my-spring-app
cd my-spring-app
Add spring-rs to your Cargo.toml:
[dependencies]
spring = "0.1"
spring-web = "0.1"
tokio = { version = "1", features = ["full"] }
2. Create Configuration
Create config/app.toml:
[web]
host = "0.0.0.0"
port = 8080
3. Write Your Application
use spring::App;
use spring_web::{get, WebPlugin};
use spring_web::axum::response::IntoResponse;
#[get("/")]
async fn hello() -> impl IntoResponse {
"Hello, Spring RS!"
}
#[tokio::main]
async fn main() {
App::new()
.add_plugin(WebPlugin)
.run()
.await
}
4. Use the Extension
- Open your project in VS Code
- The extension will automatically detect your spring-rs application
- Click the Spring RS icon in the Activity Bar
- Click the ▶️ (Run) button next to your app
- Once running, explore Components, Routes, and other views
Configuration
Extension Settings
This extension contributes the following settings:
spring-rs.serverPath: Path to spring-lsp executable (leave empty to use bundled version)
spring-rs.openWith: Browser to use when opening apps (integrated or external)
spring-rs.openUrl: URL template for opening apps (default: http://localhost:{port}{contextPath})
spring-rs.enableGutter: Show gutter icons in editors (on or off)
spring-rs.env: Environment variables to set when running apps
spring-rs.trace.server: Trace LSP communication (off, messages, or verbose)
Example Configuration
{
"spring-rs.openWith": "external",
"spring-rs.env": {
"RUST_LOG": "debug",
"DATABASE_URL": "postgres://localhost/mydb"
},
"spring-rs.trace.server": "messages"
}
Usage
Running Applications
Single Application:
- Click the ▶️ (Run) button in the Apps view
- Or right-click an app → "Run"
With Profile:
- Right-click an app → "Run with Profile..."
- Select one or more profiles (e.g.,
dev, prod)
Multiple Applications:
- Click the "Run Multiple Apps" button in the view title
- Select apps to run
Debugging Applications
- Click the 🐛 (Debug) button in the Apps view
- Or right-click an app → "Debug"
- Set breakpoints in your Rust code
- Use VS Code's debugging features
Once an application is running:
Components View - See all registered components
- Click a component to navigate to its definition
- Right-click → "Show Dependencies" to visualize the dependency graph
Routes View - Browse all HTTP endpoints
- Grouped by HTTP method (GET, POST, etc.)
- Click a route to navigate to the handler function
- Right-click GET routes → "Open in Browser"
Jobs View - See scheduled tasks
- View cron expressions and schedules
- Navigate to job definitions
Plugins View - Inspect loaded plugins
- See plugin names and versions
- View plugin configurations
Opening in Browser
From Apps View:
- Click the 🌐 (Globe) button next to a running app
From Routes View:
- Right-click a GET route → "Open in Browser"
Custom URL Template:
{
"spring-rs.openUrl": "https://myapp.local:{port}{contextPath}"
}
Keyboard Shortcuts
| Command |
Shortcut |
Description |
| Refresh Apps |
- |
Refresh the application list |
| Show Welcome |
- |
Show the welcome page |
| Open Documentation |
- |
Open spring-rs documentation |
You can customize shortcuts in VS Code's Keyboard Shortcuts editor.
Troubleshooting
Language Server Not Starting
Problem: Extension shows "Language server failed to start"
Solutions:
Check if spring-lsp is installed:
spring-lsp --version
Specify the path manually:
{
"spring-rs.serverPath": "/path/to/spring-lsp"
}
Install from source:
cargo install spring-lsp
Application Not Detected
Problem: Your spring-rs app doesn't appear in the Apps view
Solutions:
Ensure Cargo.toml includes spring-rs dependencies:
[dependencies]
spring = "0.1"
Ensure your crate is a binary (has src/main.rs or [[bin]] section)
Click the refresh button in the Apps view
Check the Output panel (View → Output → Spring RS) for errors
Port Detection Issues
Problem: Extension can't detect the application port
Solutions:
Ensure config/app.toml has the port configured:
[web]
port = 8080
The extension will use port 8080 by default if not configured
Components/Routes Not Showing
Problem: Views are empty even though the app is running
Solutions:
Ensure the language server is running (check Output panel)
Wait a few seconds for the app to fully start
Click the refresh button in the view
Check if the app is actually running (look for the green icon)
Known Issues
- Gutter icons feature is not yet implemented
- Code snippets are not yet available
- Multi-workspace support is limited
See the issue tracker for a complete list.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Development Setup
Clone the repository:
git clone https://github.com/spring-rs/spring-lsp.git
cd spring-lsp/vscode
Install dependencies:
npm install
Open in VS Code:
code .
Press F5 to launch the Extension Development Host
Make changes and reload the window (Ctrl+R / Cmd+R)
Debugging the Extension
For detailed debugging instructions, see DEBUG_EXTENSION.md.
Quick Start:
- Start watch mode:
npm run watch
- Press F5 to start debugging
- Set breakpoints in TypeScript files
- Test in the Extension Development Host window
Available Debug Configurations:
- Run Extension - Debug basic functionality
- Run Extension (with test project) - Debug with a specific project
- Extension Tests - Debug automated tests
Resources
License
This extension is licensed under either of:
at your option.
Acknowledgments
This extension is inspired by:
Special thanks to the spring-rs community and all contributors!
Enjoy coding with Spring RS! 🚀