ToolStabil
Velisch Language Server (LSP)
Language Server Protocol für vollständige IDE-Unterstützung in jedem Editor.
Installation
cd tools/lsp
cargo build --releaseFeatures
Auto-Completion
Vollständige Code-Vervollständigung für Funktionen, Structs, Variablen
Go-to-Definition
Springe zur Definition von Funktionen, Structs und Variablen
Hover-Informationen
Zeigt Signaturen, Dokumentation und Typ-Informationen
Error Highlighting
Zeigt Compiler-Fehler direkt im Editor
Code Formatting
Automatische Code-Formatierung
Refactoring
Rename Symbol, Extract Function, Inline Variable
Verwendung
velin-lspDer LSP Server kommuniziert über stdin/stdout mit dem Client.
Editor-Integration
VS Code
Der LSP Server wird automatisch von der VS Code Extension verwendet.
Neovim
init.lualua
local lspconfig = require('lspconfig')
lspconfig.velin.setup({
cmd = {'velin-lsp'},
filetypes = {'velin'},
root_dir = lspconfig.util.root_pattern('velin.toml', '.git'),
})Emacs (lsp-mode)
(require 'lsp-mode)
(add-to-list 'lsp-language-id-configuration '(velin-mode . "velin"))
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection "velin-lsp")
:activation-fn (lsp-activate-on "velin")
:server-id 'velin))Vim (vim-lsp)
if executable('velin-lsp')
au User lsp_setup call lsp#register_server({
\ 'name': 'velin-lsp',
\ 'cmd': {server_info->['velin-lsp']},
\ 'whitelist': ['velin'],
\ })
endifLSP Features im Detail
Completion
{
"label": "string.split",
"kind": 2,
"detail": "fn(string, string) -> List<string>",
"documentation": "Teilt einen String an einem Delimiter"
}Diagnostics
{
"diagnostics": [
{
"range": {
"start": {"line": 10, "character": 5},
"end": {"line": 10, "character": 12}
},
"severity": 1,
"message": "Variable 'unused' wird nicht verwendet",
"source": "velin-compiler"
}
]
}Konfiguration
VS Code Settingsjson
{
"velin.lsp.path": "velin-lsp",
"velin.lsp.trace": "off",
"velin.lsp.logLevel": "info"
}Performance
Caching
Cached Parsed ASTs, Type-Informationen und Symbol-Tabellen
Incremental Updates
Nur geänderte Dateien werden neu geparst
Optimierte Resolution
Effiziente Symbol-Resolution für große Projekte
Troubleshooting
LSP Server startet nicht
- Prüfe, ob
velin-lspim PATH ist - Prüfe LSP-Logs in VS Code (Output Panel)
- Prüfe Firewall-Einstellungen
Auto-Completion funktioniert nicht
- Prüfe, ob Datei als .velin erkannt wird
- Prüfe LSP-Status in VS Code (Status Bar)
- Starte LSP Server neu