-
Notifications
You must be signed in to change notification settings - Fork 0
IDE Integration
Status: ✅ Complete
Phase: Phase 2
Last Updated: December 9, 2025
The IDE Integration module connects ricecoder to popular IDEs and editors (VS Code, vim, neovim, emacs). Ricecoder queries external LSP servers for semantic intelligence and passes results to IDE extensions. This enables IDE users to access ricecoder's AI-powered features while leveraging specialized, maintained language tools.
Key Principle: Ricecoder does NOT implement LSP servers. Instead, it integrates with external LSP servers (rust-analyzer, typescript-language-server, pylsp) and passes their semantic intelligence to IDEs.
- External LSP-First Architecture: Prioritizes external LSP servers for semantic intelligence
- Graceful Fallback Chain: Falls back through configured rules → built-in providers → generic features
- Hot-Reload Support: Configuration and provider availability changes without restart
- Multi-IDE Support: VS Code, vim, neovim, emacs integrations
- IDE-Specific Configuration: Per-IDE settings and customization
- Clear Error Messages: Configuration validation with remediation steps
The IDE integration uses a priority-based provider chain to deliver semantic intelligence:
1. External LSP Servers (rust-analyzer, typescript-language-server, pylsp)
↓ (If unavailable or fails)
2. Configured IDE Rules (YAML/JSON configuration files)
↓ (If unavailable or fails)
3. Built-in Language Providers (Rust, TypeScript, Python)
↓ (If unavailable or fails)
4. Generic Text-Based Features (Fallback for any language)
┌─────────────────────────────────────────────────────────────────────────┐
│ IDE Extensions Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌────────────┐ │
│ │ VS Code │ │ Vim/Neovim │ │ Emacs │ │ Other │ │
│ │ Extension │ │ Plugin │ │ Integration │ │ IDEs │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ └────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
│
IDE-specific communication protocols
(JSON-RPC, stdio, sockets, etc.)
│
┌─────────────────────────────────────────────────────────────────────────┐
│ IDE Integration Manager │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ IDE Request Handler │ │
│ │ - Receives requests from IDE extensions │ │
│ │ - Routes to appropriate provider chain │ │
│ │ - Formats responses for IDE consumption │ │
│ └──────────────────────────────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ Provider Chain Manager │ │
│ │ - Priority 1: External LSP Servers │ │
│ │ - Priority 2: Configured IDE Rules │ │
│ │ - Priority 3: Built-in Language Providers │ │
│ │ - Priority 4: Generic Text-based Features │ │
│ └──────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
│
┌─────────────────────────────────────────────────────────────────────────┐
│ External LSP Integration Layer │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ ricecoder-external-lsp (Tier 1 Support) │ │
│ │ - rust-analyzer (Rust) │ │
│ │ - typescript-language-server (TypeScript/JavaScript) │ │
│ │ - pylsp (Python) │ │
│ │ - Process management, health checks, restart policies │ │
│ └──────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
Native VS Code extension with full integration:
- Completion provider
- Diagnostics provider
- Hover information
- Definition navigation
- Command palette integration
- Settings integration
Status: ✅ Complete
Plugin support for vim and neovim:
- Completion integration
- Diagnostics display
- Hover information
- Definition navigation
- Plugin manager support (vim-plug, packer, lazy.nvim)
Status: ✅ Complete
See: Terminal Editor Integration Guide
Integration for emacs:
- Completion support
- Diagnostics display
- Hover information
- Definition navigation
- Package manager support (use-package, straight.el)
Status: ✅ Complete
See: Terminal Editor Integration Guide
IDE integration configuration is loaded from (in priority order):
- Runtime overrides (CLI flags, API calls)
- IDE-specific settings (VS Code settings.json, vim config, emacs config)
- Project-level configuration:
projects/ricecoder/config/ide-integration.yaml - User-level configuration:
~/.ricecoder/ide-integration.yaml - Built-in defaults
Configuration uses YAML format for human readability:
# IDE Integration Configuration
vscode:
enabled: true
port: 8080
features:
- completion
- diagnostics
- hover
- definition
settings:
timeout_ms: 5000
max_results: 50
terminal:
vim:
enabled: true
plugin_manager: vim-plug
neovim:
enabled: true
plugin_manager: lazy.nvim
emacs:
enabled: true
package_manager: use-package
providers:
external_lsp:
enabled: true
health_check_interval_ms: 5000
servers:
rust:
language: rust
command: rust-analyzer
timeout_ms: 10000
typescript:
language: typescript
command: typescript-language-server
args: ["--stdio"]
timeout_ms: 10000
python:
language: python
command: pylsp
timeout_ms: 10000
configured_rules:
enabled: true
rules_path: config/ide-rules.yaml
builtin_providers:
enabled: true
languages:
- rust
- typescript
- pythonAll configuration is validated on load:
- Required fields are checked
- Field values are validated
- Invalid configuration is rejected with clear error messages
- Error messages include remediation steps
Example Error Message:
Configuration Error: Invalid value for 'providers.external_lsp.health_check_interval_ms'
Expected: positive integer (milliseconds)
Got: -1000
Remediation: Set to a positive value (e.g., 5000 for 5 seconds)
Provides intelligent code completion suggestions:
- Source: External LSP servers (primary), configured rules, built-in providers
- Trigger: Automatic on typing or manual (Ctrl+Space)
- Features: Snippet expansion, documentation, type information
- Fallback: Generic word-based completion
Displays code issues and errors:
- Source: External LSP servers (primary), configured rules, built-in providers
- Display: Inline in editor, problems panel
- Features: Error/warning/info levels, quick fixes
- Fallback: Generic syntax error detection
Shows symbol information on hover:
- Source: External LSP servers (primary), configured rules, built-in providers
- Display: Tooltip on mouse hover
- Features: Type information, documentation, source location
- Fallback: Generic symbol lookup
Navigate to symbol definitions:
- Source: External LSP servers (primary), configured rules, built-in providers
- Trigger: Ctrl+Click or Go to Definition command
- Features: Jump to definition, peek definition
- Fallback: Generic pattern-based search
Configuration and provider availability changes are detected automatically without restart:
When configuration files change:
- Configuration is reloaded
- Provider chain is updated
- IDE extensions are notified
- New configuration takes effect immediately
LSP server availability is monitored continuously:
- Health checks run periodically (configurable interval)
- When LSP becomes available: automatically switch to LSP provider
- When LSP becomes unavailable: automatically fall back to next provider
- IDE extensions are notified of provider changes
1. LSP server is running and providing completions
2. LSP server crashes
3. Health check detects failure
4. System falls back to configured rules provider
5. User continues working with fallback provider
6. LSP server restarts
7. Health check detects availability
8. System switches back to LSP provider
9. User gets LSP completions again (no restart needed)
When a provider fails, the system gracefully falls back:
- External LSP unavailable: Fall back to configured rules (preserve functionality)
- Configured rules unavailable: Fall back to built-in providers (preserve functionality)
- Built-in providers unavailable: Fall back to generic features (preserve functionality)
- All providers unavailable: Return generic error with fallback suggestion
Invalid configuration is rejected with clear remediation:
- Parse errors: Report line number and remediation steps
- Missing fields: Report missing field with example configuration
- Invalid values: Report invalid value with list of valid options
- Path errors: Report path error with remediation (use ricecoder_storage::PathResolver)
Connection issues are handled gracefully:
- Connection lost: Attempt reconnect with exponential backoff (max 5 retries)
- Request timeout: Return timeout error to IDE with configurable timeout
- Protocol mismatch: Log error and attempt recovery
- IDE extension disconnected: Clean up resources and prepare for reconnection
Problem: "LSP server not found for language X"
Solutions:
- Install the LSP server for your language:
- Rust:
rustup component add rust-analyzer - TypeScript:
npm install -g typescript-language-server - Python:
pip install python-lsp-server
- Rust:
- Verify the LSP server is in your PATH
- Check configuration for correct server command
Problem: Code completions are not appearing
Solutions:
- Check if LSP server is running: Look for health check logs
- Verify IDE extension is installed and enabled
- Check configuration for disabled providers
- Try manual trigger (Ctrl+Space in VS Code)
- Check IDE logs for errors
Problem: Configuration changes are not taking effect
Solutions:
- Verify configuration file syntax (YAML format)
- Check configuration file location (see Configuration section)
- Verify file permissions (readable by ricecoder)
- Check for configuration validation errors in logs
- Restart IDE extension if hot-reload doesn't work
Problem: IDE extension cannot connect to ricecoder
Solutions:
- Verify ricecoder is running
- Check port configuration (default: 8080 for VS Code)
- Verify firewall allows connection
- Check IDE extension logs for connection errors
- Try restarting IDE extension
Problem: Completions or diagnostics are slow
Solutions:
- Check LSP server health (may be overloaded)
- Increase timeout values in configuration
- Reduce number of results in configuration
- Check system resources (CPU, memory)
- Try disabling less-used providers
- LSP provider: 50-200ms (depends on LSP server)
- Configured rules: 10-50ms
- Built-in providers: 20-100ms
- Generic fallback: 5-20ms
- LSP provider: 100-500ms (depends on file size and LSP server)
- Configured rules: 20-100ms
- Built-in providers: 50-200ms
- Generic fallback: 10-50ms
- IDE Integration Manager: ~5-10 MB
- Provider Registry: ~2-5 MB per language
- Configuration Cache: ~1-2 MB
- Total: ~10-30 MB depending on configuration
- Tier 1 LSP Support Only: Only rust-analyzer, typescript-language-server, and pylsp are officially supported
- Single LSP Per Language: Only one LSP server per language is supported
- No LSP Server Implementation: Ricecoder does not implement LSP servers
- Configuration-Based Customization: Custom behavior requires configuration files
- Hot-reload may take up to 5 seconds to detect changes
- Some IDE extensions may not support all features
- Performance depends on LSP server implementation
- VS Code Extension Guide - VS Code-specific setup and usage
- Terminal Editor Integration Guide - vim/neovim/emacs setup
- Architecture Overview - System architecture
- Contributing Guide - Contributing to ricecoder
Last updated: December 9, 2025