CLI Usage¶
The cdl-lsp command starts the CDL Language Server.
Installation¶
The CLI is installed automatically with the package:
Basic Usage¶
Standard I/O Mode¶
The default mode uses stdin/stdout for communication:
This is the mode used by most editors.
TCP Mode¶
For debugging or remote connections:
Command Line Options¶
--tcp¶
Start the server in TCP mode instead of stdio mode.
--host¶
Specify the host address for TCP mode (default: 127.0.0.1).
--port¶
Specify the port for TCP mode (default: 2087).
--log-file¶
Write logs to a file.
--log-level¶
Set the logging level (DEBUG, INFO, WARNING, ERROR).
--version¶
Show version information.
--help¶
Show help message.
Examples¶
Development/Debugging¶
Start with verbose logging for debugging:
Then tail the log file:
Remote Server¶
Start a TCP server accessible from other machines:
Warning
Only expose the server on trusted networks.
Testing with netcat¶
Test the TCP server manually:
# Start server
cdl-lsp --tcp --port 2087 &
# Connect with netcat
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"capabilities":{}}}' | nc localhost 2087
Editor Configuration¶
VS Code¶
In VS Code settings (settings.json):
Neovim¶
In your Neovim config:
require('lspconfig').cdl_lsp.setup{
cmd = {'cdl-lsp', '--log-file', '/tmp/cdl-lsp.log'},
filetypes = {'cdl'},
root_dir = function() return vim.loop.cwd() end,
}
Sublime Text¶
In LSP settings:
{
"clients": {
"cdl": {
"command": ["cdl-lsp", "--log-file", "/tmp/cdl-lsp.log"],
"selector": "source.cdl"
}
}
}
Emacs (lsp-mode)¶
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection '("cdl-lsp"))
:major-modes '(cdl-mode)
:server-id 'cdl-lsp))
Troubleshooting¶
Server Not Starting¶
-
Check that the package is installed:
-
Verify the command is in PATH:
-
Try running directly:
No Completions¶
-
Check logs for errors:
-
Verify the file type is recognized (
.cdlextension) -
Check editor LSP client configuration
High CPU Usage¶
- Check for infinite loops in the log file
- Reduce validation frequency in settings
- Report issue with reproduction steps
Preview Not Working¶
Install optional preview dependencies: