🔧 Language Server Protocol (LSP) Setup
Complete LSP implementation for Nixi with intelligent code assistance across all major editors and IDEs.
📦 Installation
Step 1: Install Prerequisites
Node.js 14+
Required to run the LSP server
Your Favorite Editor
See supported editors below
Step 2: Install Nixi LSP
cd lsp
npm install
Step 3: Configure Your Editor
Choose your editor below for detailed setup instructions.
✨ LSP Features
Smart Code Completion
Context-aware auto-completion for Nixi keywords, HTML tags, CSS properties, and JavaScript functions.
Real-time Diagnostics
Instant error detection and highlighting as you type, with detailed error messages and suggestions.
Hover Documentation
Rich documentation on hover for language constructs, components, and CSS properties.
Go to Definition
Navigate directly to component definitions, variable declarations, and function implementations.
Find References
Locate all uses of components, variables, and functions across your project.
Code Actions
Automated refactoring suggestions, quick fixes, and code improvements.
📝 Supported Editors
🛠️ Detailed Setup Guides
🟦 Neovim Setup
# Install lspconfig if not already installed
:Plug 'neovim/nvim-lspconfig'
# Copy configuration
mkdir -p ~/.config/nvim/lua/nixi
cp lsp/editor-configs/neovim/nixi-lsp.lua ~/.config/nvim/lua/nixi/
# Add to init.lua
echo 'require("nixi.nixi-lsp")' >> ~/.config/nvim/init.lua
Key features: Full LSP support, modal editing, fast performance, tree-sitter integration
🟨 Cursor Editor Setup
# Copy configuration
mkdir -p ~/.cursor/extensions/
cp lsp/editor-configs/cursor/nixi-lsp.json ~/.cursor/extensions/
# Add to workspace settings
echo '{
"language_servers": {
"nixi": {
"command": "node",
"args": ["/home/jadu/code/nixi/lsp/src/server.js"],
"filetypes": ["nixi"]
}
}
}' > .cursor/settings.json
Key features: AI integration, modern UI, built-in LSP support, intelligent completion
🟩 Helix Setup
# Copy configuration
mkdir -p ~/.config/helix/languages
cp lsp/editor-configs/helix/languages.toml ~/.config/helix/languages/
# Update server path in ~/.config/helix/languages.toml:
# args = ["/your/path/to/nixi/lsp/src/server.js"]
Key features: Modal editing, built-in LSP client, tree-sitter support, excellent performance
🟣 Emacs Setup
# Install packages (use-package recommended)
(use-package lsp-mode :ensure t)
(use-package company :ensure t)
(use-package flycheck :ensure t)
# Copy configuration
mkdir -p ~/.emacs.d/lisp
cp lsp/editor-configs/emacs/nixi-mode.el ~/.emacs.d/lisp/
# Add to init.el
(echo '(add-to-list '"'"'load-path'"'"' "~/.emacs.d/lisp")
(require '"'"'nixi-mode'"'"')
(add-to-list '"'"'auto-mode-alist'"'"' '"'"'("\\.nixi\\'"'"' . nixi-mode))' >> ~/.emacs.d/init.el)
Key features: Extensible, org-mode integration, evil-mode support, company completion
🟦 VS Code Setup
# Option 1: Install from source
cd lsp/vscode-extension
code --install-extension .
# Option 2: Copy to extensions directory
mkdir -p ~/.vscode/extensions/nixi-lsp
cp -r lsp/vscode-extension/* ~/.vscode/extensions/nixi-lsp/
Key features: Rich extension ecosystem, marketplace support, debugging tools, Git integration
🔵 Kate/KDevelop Setup
# For Kate
mkdir -p ~/.config/kate/lspclient
cp lsp/editor-configs/kate/nixi-lsp.json ~/.config/kate/lspclient/
# For KDevelop
mkdir -p ~/.config/kdevlspclient
cp lsp/editor-configs/kate/nixi-lsp.json ~/.config/kdevlspclient/
# Configure in Settings → Configure Kate/KDevelop → LSP Client
Key features: KDE integration, project management, built-in debugging, Git support
🟠 Kakoune Setup
# Install kak-lsp
cargo install kak-lsp
# Copy configuration
mkdir -p ~/.config/kak-lsp
cp lsp/editor-configs/kakoune/kak-lsp.toml ~/.config/kak-lsp/
# Add to kakrc
echo 'eval %sh{kak-lsp --kakoune -s $kak_session}' >> ~/.config/kak/kakrc
Key features: Modal editing, minimal dependencies, multiple selections, Vim-like keybindings
🟠 Sublime Text Setup
# Install LSP plugin
# Package Control → Install Package → "LSP"
# Copy configuration
mkdir -p ~/.config/sublime-text-3/Packages/LSP
cp lsp/editor-configs/sublime/nixi-lsp.json ~/.config/sublime-text-3/Packages/LSP/
# Configure in Preferences → Package Settings → LSP → Server Settings
Key features: Fast startup, minimal UI, command palette, multiple cursors, Goto Anything
🔧 Troubleshooting
LSP Not Starting
- Verify Node.js installation:
node --version - Check LSP server path in configuration
- Ensure firewall allows localhost connections
- Test server manually:
node lsp/src/server.js
No Auto-completion
- Check file type detection (should be "nixi")
- Restart your editor
- Verify LSP server is running
- Check completion triggers in settings
Syntax Highlighting Issues
- Install syntax highlighting files
- Restart editor to reload syntax files
- Check file association settings
- Consider tree-sitter if available
Performance Issues
- Limit completion items in settings
- Disable unused LSP features
- Check file size limits
- Enable incremental sync if supported