LSP & Languages
Language Server Protocol support and language features
Overview
Agentastic supports the Language Server Protocol (LSP) for intelligent code features across 100+ programming languages.
Language Features
When a language server is configured, you get:
- Auto-completion - Context-aware suggestions
- Go to Definition - Jump to symbol definitions
- Find References - Find all usages of a symbol
- Hover Information - Documentation on hover
- Diagnostics - Errors and warnings inline
- Code Actions - Quick fixes and refactorings
- Document Symbols - Outline view of the file
- Semantic Highlighting - Enhanced syntax coloring
Supported Languages
Agentastic includes built-in syntax highlighting for over 100 languages via Tree-sitter, including:
| Category | Languages |
|---|---|
| Web | JavaScript, TypeScript, HTML, CSS, React, Vue |
| Systems | C, C++, Rust, Go, Zig |
| Mobile | Swift, Kotlin, Objective-C |
| Scripting | Python, Ruby, Perl, Lua |
| Data | JSON, YAML, TOML, XML |
| Shell | Bash, Zsh, Fish |
| And more... | Haskell, Elixir, Clojure, Scala, etc. |
Setting Up LSP
Automatic Detection
Agentastic automatically detects and connects to common language servers if they're installed on your system.
Manual Configuration
For custom setups, configure language servers in Settings > LSP:
- Add a new language server configuration
- Specify the executable path
- Set the languages it handles
- Configure initialization options
Common Language Servers
| Language | Server | Install |
|---|---|---|
| TypeScript | typescript-language-server | npm install -g typescript-language-server |
| Python | pyright | npm install -g pyright |
| Rust | rust-analyzer | rustup component add rust-analyzer |
| Go | gopls | go install golang.org/x/tools/gopls@latest |
| Swift | sourcekit-lsp | Included with Xcode |
Semantic Tokens
Language servers provide semantic token information for enhanced syntax highlighting beyond regex-based patterns. This provides more accurate coloring for:
- Variable types
- Function calls vs definitions
- Namespaces and modules
- Macro expansions
Outline View
The Outline view in the Navigator shows the document structure provided by the language server:
- Classes and structs
- Functions and methods
- Properties and fields
- Constants and variables
Click any symbol to jump to its location.
Troubleshooting
If language features aren't working:
- Verify the language server is installed
- Check the LSP configuration in Settings
- Ensure the project is properly opened
- Check the output panel for LSP errors