Language server
Features
Code completion
The language server provides intelligent code completion for:
-
Built-in types and type aliases.
-
Datapoints and functions.
-
Field names in records.
-
Annotations (e.g.
@derived,@hidden, etc.). -
Module names and imports.
-
Meta keys.
Completion is triggered automatically when typing, or manually with:
-
.for field access. -
^for annotations. -
>for advanced completions. -
@for meta keys. -
:for type annotations.
Diagnostics
Real-time error checking and warnings:
-
Syntax errors.
-
Type errors.
-
Unreachable code.
-
Debug information (optional).
-
Configure via:
{ "brossa.languageServer": { "diagnostics": { "unreachable": true, "debug": false } } }
Document symbols
View the structure of your Brossa files:
-
Open the outline view to see all symbols.
-
Includes functions, variables, and type aliases.
-
Shows symbol hierarchy and relationships.
-
Helps navigate large files.
Find references
Find all usages of a symbol across your codebase:
-
Right-click and select "Find All References".
-
Shift + F12 keyboard shortcut.
Go to definition
Navigate to the definition of any symbol by:
-
Clicking while holding Ctrl/Cmd.
-
Using the "Go to Definition" command.
-
F12 keyboard shortcut.
The language server will take you to the original declaration, even if it’s in a different file.
Hover information
Hover over any symbol to see:
-
Type information.
-
Documentation for built-in functions.
-
Usage information for type aliases.
-
List of dependent goals that use the symbol.
-
Additional context about the symbol’s purpose.
Configuration
The language server can be configured through VS Code settings:
{
"brossa.languageServer": {
"path": "/path/to/brossa-lsp-server",
"inlayHints": {
"enabled": true,
"cutoff": 80
},
"diagnostics": {
"unreachable": true,
"debug": false
}
}
}
Troubleshooting
If you encounter issues:
-
Check the language server is properly installed and in your PATH..
-
Verify VS Code settings are correctly configured
-
Look for errors in the VS Code "Output" panel (select "Brossa Language Server").
-
Try restarting the language server:.
-
Command Palette → "Developer: Restart Language Server".
-
Or reload VS Code window.
-