Skip to main content

Language server for Helios, a non-Haskell Cardano smart contract DSL.

Project description

helios-language-server

image-version image-python-versions

Language server for Helios, a non-Haskell Cardano smart contract language. Uses the pygls lsp framework and tree-sitter for syntax tree generation.

auto-complete

Requirements

  • Python >=3.7
  • python3-pip (Ubuntu/Debian)
  • python3-venv (Ubuntu/Debian)

Installation

coc.nvim

  1. Easy way via npm package coc-helios:

    :CocInstall coc-helios

  2. 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 have filetype.nvim plugin installed.

VSCode

  See vscode-helios.

Capabilities

  • Auto-completions
  • Hover
  • Signature help
  • Syntax errors
  • Go to definition

Comments and tips (IMPORTANT)

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

helios-language-server-0.3.0.tar.gz (43.5 kB view hashes)

Uploaded Source

Built Distribution

helios_language_server-0.3.0-py3-none-any.whl (44.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page