Atmos LSP Server
The Atmos LSP Server enables IDE and editor integration for Atmos stack files. It provides real-time syntax validation, intelligent autocomplete, hover documentation, and error diagnostics directly in your editor as you work with Atmos configuration files.
Looking for generic YAML/Terraform validation for Atmos AI? See the LSP Client, which connects to external language servers (yaml-ls, terraform-ls).
Features
Syntax Validation
The LSP server validates YAML syntax and Atmos-specific structure in real-time:
- YAML syntax errors (invalid indentation, incorrect types)
- Atmos structure validation (import arrays, component maps)
- Component name validation
- Variable structure validation
- Precise error locations with line numbers
Basic Autocomplete
Get suggestions based on current line context:
- Top-level keywords:
import,components,vars,settings,metadata - Component types:
terraform,helmfile - Stack configuration options
- Import path suggestions
- Variable definitions
Note: Completions are based on current line matching, not full YAML hierarchy parsing. For example, typing "comp" on a new line suggests "components".
Hover Documentation
Hover over Atmos keywords to see inline documentation explaining their purpose and usage.
Transport Options
The Atmos LSP Server supports multiple transport mechanisms:
- stdio (default) - Standard input/output for local IDE integration
- tcp - TCP server for remote connections
- websocket - WebSocket server for web-based editors
Quick Start
Get started with Atmos LSP Server in 3 steps:
1. Start the LSP Server
Start the Atmos LSP Server with the default stdio transport:
- stdio (default): Use for local IDE integration (VS Code, Neovim, etc.)
- tcp: Use for remote development or when stdio isn't available
- websocket: Use for web-based editors
2. Configure Your Editor
Configure your editor to connect to the Atmos LSP Server. See Editor Configuration below for specific examples.
3. Open Atmos Stack Files
Open any Atmos stack file (.yaml or .yml) in your editor and start getting real-time feedback!
Command Options
atmos lsp start
Starts the Atmos Language Server Protocol (LSP) server.
Flags:
--transport- Transport protocol:
stdio,tcp, orwebsocket(default:stdio) --address- Address for tcp/websocket transports in
host:portformat (default:localhost:7777)
Examples:
Editor Configuration
Configure your editor to connect to the Atmos LSP Server. The configuration varies by editor but follows a similar pattern: specify the command to start the server and which file types to activate for.
- VS Code
- Neovim
- Vim (vim-lsp)
- Vim (coc.nvim)
- Emacs (lsp-mode)
- Emacs (eglot)
- Sublime Text
- IntelliJ IDEA
- Cursor
- Zed
- Helix
Create or update .vscode/settings.json in your workspace or use a VS Code extension.
Option 1: Using Generic LSP Extension
Install the vscode-language-server-client or create a custom extension.
.vscode/settings.json
Option 2: Using tasks.json to Start Server
.vscode/tasks.json
Then configure the LSP client in settings.json:
.vscode/settings.json
Option 3: Create Custom VS Code Extension
For the best experience, create a custom VS Code extension. Create a new directory with:
package.json
src/extension.ts
Neovim has excellent built-in LSP support. Configure using nvim-lspconfig or manually.
Using nvim-lspconfig
~/.config/nvim/lua/lsp/atmos.lua
Then source it in your init.lua:
~/.config/nvim/init.lua
Manual Configuration (without nvim-lspconfig)
~/.config/nvim/init.lua
Install vim-lsp for LSP support in Vim.
~/.vimrc
If you use coc.nvim, configure it via :CocConfig:
coc-settings.json
Configure using lsp-mode:
~/.emacs.d/init.el
Configure using eglot (built-in to Emacs 29+):
~/.emacs.d/init.el
Install the LSP package for Sublime Text:
- Open Command Palette:
Cmd+Shift+P(macOS) orCtrl+Shift+P(Windows/Linux) - Run:
Package Control: Install Package - Search and install:
LSP
Then configure Atmos LSP server:
Preferences → Package Settings → LSP → Settings
Install the LSP Support plugin:
- Go to
Preferences → Plugins - Search for "LSP Support" or install from JetBrains Marketplace
- Install and restart
Configure the Atmos LSP server:
- Go to
Preferences → Languages & Frameworks → Language Server Protocol → Server Definitions - Click
+to add a new server definition:- Extension:
yaml;yml - Path: Raw command
- Command:
atmos lsp start --transport stdio
- Extension:
Alternatively, create a custom LSP configuration file:
.idea/lsp/atmos.xml
Cursor uses the same configuration as VS Code. Follow the instructions in the VS Code tab.
.vscode/settings.json
Zed has built-in LSP support. Configure in ~/.config/zed/settings.json:
~/.config/zed/settings.json
Configure Helix in ~/.config/helix/languages.toml:
~/.config/helix/languages.toml
Editor Feature Matrix
- VS Code
- Setup: Easy. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Excellent.
- Neovim
- Setup: Moderate. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Excellent.
- Vim (vim-lsp)
- Setup: Moderate. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Great.
- Vim (coc.nvim)
- Setup: Easy. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Excellent.
- Emacs (lsp-mode)
- Setup: Moderate. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Excellent.
- Emacs (eglot)
- Setup: Easy. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Great.
- Sublime Text
- Setup: Easy. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Great.
- IntelliJ IDEA
- Setup: Moderate. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Good.
- Cursor
- Setup: Easy. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Excellent.
- Zed
- Setup: Easy. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Great.
- Helix
- Setup: Easy. Autocomplete: Yes. Diagnostics: Yes. Hover: Yes. Go to Definition: Planned. Rating: Great.
Legend: Yes = Fully supported. Planned = Stub implemented, will be enhanced in future versions. Rating: Excellent (highly recommended), Great (recommended), Good (acceptable).
Troubleshooting
LSP Server Not Starting
Symptoms:
- Editor shows "LSP server failed to start"
- No autocomplete or diagnostics appear
Solutions:
-
Verify Atmos is installed and in PATH:
which atmos
atmos --version -
Test server manually:
atmos lsp start --transport stdio
# Should show: "Starting Atmos LSP server..." -
Check editor logs for errors:
- VS Code: Output → Select "Atmos LSP" from dropdown
- Neovim:
:LspLogor:lua vim.lsp.set_log_level("debug") - Vim: Check
:messages - Emacs:
*lsp-log*buffer
-
Ensure correct command syntax:
# Correct
atmos lsp start --transport stdio
# Incorrect
atmos lsp start --stdio # Wrong flag name
No Diagnostics Shown
Symptoms:
- LSP server starts but no errors/warnings appear
- Autocomplete works but validation doesn't
Solutions:
-
Verify file is recognized as YAML:
- Check file extension is
.yamlor.yml - Verify editor recognizes file as YAML type
- Check file extension is
-
Check LSP server is initialized:
- Neovim:
:LspInfo- should show "atmos_ls" or "atmos-lsp" as active - Vim:
:LspStatus- should show server running - VS Code: Look for LSP indicator in status bar
- Neovim:
-
Introduce a known error to test:
import: "not-an-array" # Should error: import must be array -
Check Atmos logs:
ATMOS_LOGS_LEVEL=Debug atmos lsp start --transport stdio
Autocomplete Not Working
Symptoms:
- No suggestions appear when typing
- Empty autocomplete menu
Solutions:
-
Trigger autocomplete manually:
- VS Code:
Ctrl+Space - Neovim:
Ctrl+X Ctrl+O(insert mode) - Vim:
Ctrl+X Ctrl+O(insert mode) - Emacs:
M-x completion-at-point
- VS Code:
-
Verify LSP capabilities:
- Server should advertise
completionProvidercapability - Check with
:LspInfo(Neovim) or editor's LSP diagnostics
- Server should advertise
-
Check trigger characters:
- Autocomplete triggers on:
.,:,/ - Try typing these characters after keywords
- Autocomplete triggers on:
-
Ensure omnifunc is set (Vim/Neovim):
:set omnifunc?
" Should show: omnifunc=lsp#complete or v:lua.vim.lsp.omnifunc
Server Crashes or Hangs
Symptoms:
- LSP server stops responding
- Editor shows "server disconnected"
Solutions:
-
Check for large files:
- LSP server may struggle with very large YAML files (>10,000 lines)
- Try breaking up large stack files
-
Restart the server:
- VS Code:
Cmd+Shift+P→ "Reload Window" - Neovim:
:LspRestart - Vim: Restart editor
- VS Code:
-
Check system resources:
# Monitor CPU/memory usage
top -p $(pgrep atmos) -
Enable debug logging:
ATMOS_LOGS_LEVEL=Debug atmos lsp start --transport stdio 2>atmos-lsp.log -
Report issue:
- Include debug logs
- Provide minimal reproduction case
- Report at: https://github.com/cloudposse/atmos/issues
TCP/WebSocket Connection Issues
Symptoms:
- Editor can't connect to TCP/WebSocket server
- Connection refused errors
Solutions:
-
Verify server is running:
# For TCP
lsof -i :7777
netstat -an | grep 7777
# For WebSocket
lsof -i :8080
netstat -an | grep 8080 -
Test connection manually:
# For TCP
telnet localhost 7777
nc localhost 7777
# For WebSocket
curl -i -N -H "Connection: Upgrade" \
-H "Upgrade: websocket" \
http://localhost:8080 -
Check firewall settings:
# macOS
sudo pfctl -sr | grep 7777
# Linux
sudo iptables -L | grep 7777 -
Try different port:
atmos lsp start --transport tcp --address localhost:9999
File Type Not Detected
Symptoms:
- LSP doesn't activate for some YAML files
- Works in some directories but not others
Solutions:
-
Verify file associations in editor:
- VS Code: Check
files.associationsin settings - Neovim: Check
:set filetype? - Vim: Check
:set filetype?
- VS Code: Check
-
Add explicit file pattern matching:
- Configure editor to recognize all YAML files in project
- Use patterns like
**/stacks/**/*.yaml
-
Check root directory detection:
- LSP server looks for
atmos.yamlor.git - Ensure one of these exists in project root
- LSP server looks for
-
Manually set file type:
- Neovim/Vim:
:set filetype=yaml - VS Code: Click language indicator in status bar
- Neovim/Vim:
Security
- stdio (default) — No network exposure. Most secure for local development.
- tcp/websocket — Bind to
localhostonly. Use SSH tunneling for remote access. Never expose directly to the internet.
Limitations & Roadmap
Current Limitations
- Go to Definition: Stub implemented, full implementation planned
- Find References: Not yet implemented
- Rename Symbol: Not yet implemented
- Code Actions: Not yet implemented
- Semantic Tokens: Not yet implemented
Related Documentation
- LSP Client — External LSP server integration for AI validation
- LSP Command Reference — CLI flags and examples
- Language Server Protocol — Protocol specification