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:

CategoryLanguages
WebJavaScript, TypeScript, HTML, CSS, React, Vue
SystemsC, C++, Rust, Go, Zig
MobileSwift, Kotlin, Objective-C
ScriptingPython, Ruby, Perl, Lua
DataJSON, YAML, TOML, XML
ShellBash, 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:

  1. Add a new language server configuration
  2. Specify the executable path
  3. Set the languages it handles
  4. Configure initialization options

Common Language Servers

LanguageServerInstall
TypeScripttypescript-language-servernpm install -g typescript-language-server
Pythonpyrightnpm install -g pyright
Rustrust-analyzerrustup component add rust-analyzer
Gogoplsgo install golang.org/x/tools/gopls@latest
Swiftsourcekit-lspIncluded 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:

  1. Verify the language server is installed
  2. Check the LSP configuration in Settings
  3. Ensure the project is properly opened
  4. Check the output panel for LSP errors