A configurable LSP server for debugging/testing LSP clients.
# Install
nimble install lasm
# Create example config
lasm --create-sample-config
# Start server
lasm --config ./lsp-test-config-sample.jsonUsage:
lasm --config <path> # Start LSP server with config file
lasm --create-sample-config # Create sample configuration
lasm --file-log # Enable file logging
lasm --file-log-path <path> # Set log file path
lasm --help # Show helpConfigure scenarios in JSON to control LSP behavior:
- Responses and delays
- Error injection
- Feature toggles
See lsp-test-config-sample.json for examples.
| Name | Note |
|---|---|
| initialize | |
| initialized | |
| $/cancelRequest | |
| workspace/didChangeConfiguration | |
| textDocument/didOpen | |
| textDocument/didChange | |
| textDocument/didSave | |
| textDocument/didClose | |
| textDocument/hover | |
| textDocument/completion | |
| textDocument/publishDiagnostics | |
| textDocument/inlayHint | |
| textDocument/declaration | |
| textDocument/definition | |
| textDocument/typeDefinition | |
| textDocument/implementation | |
| textDocument/references | |
| textDocument/documentHighlight | |
| textDocument/rename | |
| textDocument/formatting | |
| textDocument/shutdown |
LASM provides several commands that can be executed through the LSP client:
lsptest.switchScenario- Switch to a different test scenariolsptest.listScenarios- List all available scenarioslsptest.reloadConfig- Reload configuration filelsptest.createSampleConfig- Create a sample configuration filelsptest.listOpenFiles- List all currently open files with details