Language Server Protocol implementation for the Trypillia programming language. Provides IDE features like autocompletion, hover info, diagnostics, and semantic highlighting for any LSP-compatible editor.
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config ReleaseThe binary will be at build/trypillia-lsp.
The LSP reads native module documentation from resources/native_docs.json. This file is embedded into the binary at CMake configure time and powers autocomplete suggestions, hover tooltips, and member discovery.
Key conventions:
| Pattern | Example | Type |
|---|---|---|
Module.method |
Math.sin, Result.unwrap |
Module method |
globalFunc |
print, assert |
Global function |
Module.CONSTANT |
Math.PI |
Module constant |
Entry format:
{
"Module.method": {
"signature": "Module.method(param: Type) -> ReturnType",
"doc": "One-line description.",
"params": [
{ "label": "param: Type", "doc": "Parameter description." }
]
}
}Constants vs functions: If the signature contains ( it's treated as a function (kind: 3). Otherwise it's a constant (kind: 21). For example, "Math.PI -> Number" (no parentheses) is detected as a constant.
After adding entries:
- Sort the file alphabetically:
python3 scripts/sort_native_docs.py
- Reconfigure and rebuild:
The JSON is read at configure time via
cmake -B build cmake --build build
configure_file, so a plain--buildis not sufficient — you must re-run CMake configuration.
The resources/native_docs.json file should be kept sorted by key for consistent diffs. Use the sort script to reorder entries:
python3 scripts/sort_native_docs.pyThis reads resources/native_docs.json, sorts all entries alphabetically by key, and writes the result back in-place. A custom path can be supplied:
python3 scripts/sort_native_docs.py /path/to/native_docs.jsonInstall the Trypillia VS Code extension from source.
vim.api.nvim_create_autocmd("FileType", {
pattern = "try",
callback = function()
vim.lsp.start({
name = "trypillia-lsp",
cmd = { "trypillia-lsp" },
})
end,
})Contributions are welcome and appreciated! Here's how you can contribute:
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Please make sure to update tests as appropriate and adhere to the existing coding style.
This project is licensed under the CSSM Unlimited License v2.0 (CSSM-ULv2). See the LICENSE file for details.