Language server for Helios, a non-Haskell Cardano smart contract DSL.
Project description
helios-language-server
Language server for Helios, a non-Haskell Cardano smart contract language. Uses the pygls lsp framework and tree-sitter for syntax tree generation.
Requirements
Python >=3.7
python3-pip
(Ubuntu/Debian)python3-venv
(Ubuntu/Debian)
Installation
coc.nvim
-
Easy way via npm package coc-helios:
:CocInstall coc-helios
-
Alternatively, if you know how to set up Python virtual environments:
python3 -m venv .venv
source .venv/bin/activate
pip install helios-language-server
Put this in your
coc-settings.json
file (:CocConfig
):{ "languageserver": { "helios": { "command": "helios-language-server", "args": ["--stdio"], "filetypes": ["*.hl", "hl"] } }
The language server should now activate whenever you open
.hl
files, provided you havefiletype.nvim
plugin installed.
VSCode
See vscode-helios.
Capabilities
- Auto-completions
- Hover
- Signature help
- Syntax errors
- Go to definition
Comments
Currently only supports builtin types and methods up until Helios v0.9.2 (apart from import statements).
While in general the tree-sitter parser works okay, there are several shortcomings as it is not always error tolerant. Meaning that if there are syntax errors present in the source code, the parser can sometimes generate error nodes spanning the entire document. This may lead to no/unexpected auto-completions. Unfortunately, not too much can be done about the parser's error recovery ability at this stage, as this is still also an open issue with tree-sitter. I have tried to address some commonly occuring parsing errors.
To-dos
- Parser improvements
- Advanced diagnostics
- Semantic highlighting
- Imports
- Go to definition
- Support newer Helios versions
- Tree-sitter syntax highlighting (nvim)
- Type checking
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file helios_language_server-0.3.1.tar.gz
.
File metadata
- Download URL: helios_language_server-0.3.1.tar.gz
- Upload date:
- Size: 43.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/5.15.153.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d853b920a73de42cc716e46dc17c2bb3562cabafb9a8e3b7d80cc30fd31332d2 |
|
MD5 | 6f1fed83bc334522c4f1f06eb4c03843 |
|
BLAKE2b-256 | ef2c37cba3378005406bf88162ed54b8c75979e8087d973762600166e1035004 |
File details
Details for the file helios_language_server-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: helios_language_server-0.3.1-py3-none-any.whl
- Upload date:
- Size: 44.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/5.15.153.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f13c443b767e3f01e6fa04d6899cc9c87a72bdca2f5ca61f90a5fec6f7b21b3a |
|
MD5 | ba97d3e50485756e4544ef9598af874e |
|
BLAKE2b-256 | 3edf344d4fe49202ac53e82cf776461c7495262f093eedf9ed64ade0c5fb3d13 |