helios-language-server


Namehelios-language-server JSON
Version 0.3.0 PyPI version JSON
download
home_page
SummaryLanguage server for Helios, a non-Haskell Cardano smart contract DSL.
upload_time2023-01-13 13:18:00
maintainer
docs_urlNone
authoret
requires_python>=3.7,<3.12
licenseMIT
keywords cardano helios neovim lsp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # helios-language-server

[![image-version](https://img.shields.io/pypi/v/helios-language-server.svg)](https://python.org/pypi/helios-language-server)
[![image-python-versions](https://img.shields.io/badge/python->=3.7-blue)](https://python.org/pypi/helios-language-server)

Language server for <a href="https://github.com/Hyperion-BT/Helios">Helios</a>, a non-Haskell Cardano smart contract language.
Uses the <a href="https://github.com/openlawlibrary/pygls">pygls</a> lsp framework and <a href="https://github.com/tree-sitter/tree-sitter">tree-sitter</a> for syntax tree generation.

![auto-complete](./img/auto-complete.gif)

## Requirements

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

## Installation

### coc.nvim
1. Easy way via npm package <a href="https://github.com/et9797/coc-helios">coc-helios</a>:

    `:CocInstall coc-helios`

2. Alternatively, if you know how to set up Python virtual environments:

    `python3 -m venv .venv` <br>
    `source .venv/bin/activate` <br>
    `pip install helios-language-server`
    
    Put this in your `coc-settings.json` file (`:CocConfig`):
    
    ```json
    {
        "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

&emsp; See <a href="https://github.com/Et9797/vscode-helios">vscode-helios</a>.

## Capabilities
- [x] Auto-completions
- [x] Hover
- [x] Signature help
- [x] 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 <a href="https://github.com/tree-sitter/tree-sitter/issues/1870#issuecomment-1248659929">issue</a> 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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "helios-language-server",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<3.12",
    "maintainer_email": "",
    "keywords": "cardano,helios,neovim,lsp",
    "author": "et",
    "author_email": "etet1997@hotmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a3/d7/753b75f661928ac027f64ab5fe180d86012017af8f0465550fe6184763b7/helios-language-server-0.3.0.tar.gz",
    "platform": null,
    "description": "# helios-language-server\n\n[![image-version](https://img.shields.io/pypi/v/helios-language-server.svg)](https://python.org/pypi/helios-language-server)\n[![image-python-versions](https://img.shields.io/badge/python->=3.7-blue)](https://python.org/pypi/helios-language-server)\n\nLanguage server for <a href=\"https://github.com/Hyperion-BT/Helios\">Helios</a>, a non-Haskell Cardano smart contract language.\nUses the <a href=\"https://github.com/openlawlibrary/pygls\">pygls</a> lsp framework and <a href=\"https://github.com/tree-sitter/tree-sitter\">tree-sitter</a> for syntax tree generation.\n\n![auto-complete](./img/auto-complete.gif)\n\n## Requirements\n\n* `Python >=3.7`\n* `python3-pip` (Ubuntu/Debian)\n* `python3-venv` (Ubuntu/Debian)\n\n## Installation\n\n### coc.nvim\n1. Easy way via npm package <a href=\"https://github.com/et9797/coc-helios\">coc-helios</a>:\n\n    `:CocInstall coc-helios`\n\n2. Alternatively, if you know how to set up Python virtual environments:\n\n    `python3 -m venv .venv` <br>\n    `source .venv/bin/activate` <br>\n    `pip install helios-language-server`\n    \n    Put this in your `coc-settings.json` file (`:CocConfig`):\n    \n    ```json\n    {\n        \"languageserver\": {\n          \"helios\": {\n            \"command\": \"helios-language-server\",\n            \"args\": [\"--stdio\"],\n            \"filetypes\": [\"*.hl\", \"hl\"]\n        }\n    }\n    ```\n    The language server should now activate whenever you open `.hl` files, provided you have `filetype.nvim` plugin installed. \n\n### VSCode\n\n&emsp; See <a href=\"https://github.com/Et9797/vscode-helios\">vscode-helios</a>.\n\n## Capabilities\n- [x] Auto-completions\n- [x] Hover\n- [x] Signature help\n- [x] Syntax errors\n- [ ] Go to definition\n\n## Comments and tips (**IMPORTANT**)\nCurrently only supports builtin types and methods up until **Helios v0.9.2** (apart from import statements).\n\nWhile in general the tree-sitter parser works okay, there are several shortcomings as it is not always error tolerant. \nMeaning that if there are syntax errors present in the source code, the parser can sometimes generate error nodes spanning the entire document. \nThis may lead to no/unexpected auto-completions. Unfortunately, not too much can be done about the parser's error recovery ability at this stage, \nas this is still also an open <a href=\"https://github.com/tree-sitter/tree-sitter/issues/1870#issuecomment-1248659929\">issue</a> with tree-sitter. \nI have tried to address some commonly occuring parsing errors.\n\n## To-dos\n- Parser improvements\n- Advanced diagnostics\n- Semantic highlighting\n- Imports\n- Go to definition\n- Support newer Helios versions\n- Tree-sitter syntax highlighting (nvim)\n- Type checking\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Language server for Helios, a non-Haskell Cardano smart contract DSL.",
    "version": "0.3.0",
    "split_keywords": [
        "cardano",
        "helios",
        "neovim",
        "lsp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c7e2313505fed206d5fb168305a50f17a3216e819db4910e98ef259a480b6661",
                "md5": "071c0b0dcbf3b31cd4ea262efd6e6661",
                "sha256": "cedcfe52b4eb839932f8b62e30b03fd4781b505764882283925a9628d04c1bb6"
            },
            "downloads": -1,
            "filename": "helios_language_server-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "071c0b0dcbf3b31cd4ea262efd6e6661",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<3.12",
            "size": 44767,
            "upload_time": "2023-01-13T13:18:02",
            "upload_time_iso_8601": "2023-01-13T13:18:02.085659Z",
            "url": "https://files.pythonhosted.org/packages/c7/e2/313505fed206d5fb168305a50f17a3216e819db4910e98ef259a480b6661/helios_language_server-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a3d7753b75f661928ac027f64ab5fe180d86012017af8f0465550fe6184763b7",
                "md5": "c99f96ef67f02e8c65ae2a7c853d6fc1",
                "sha256": "48f7b7f36606d0fc9eca564b353c3595f8b37011ce7f88f7da78740870dd6356"
            },
            "downloads": -1,
            "filename": "helios-language-server-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c99f96ef67f02e8c65ae2a7c853d6fc1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<3.12",
            "size": 43502,
            "upload_time": "2023-01-13T13:18:00",
            "upload_time_iso_8601": "2023-01-13T13:18:00.799666Z",
            "url": "https://files.pythonhosted.org/packages/a3/d7/753b75f661928ac027f64ab5fe180d86012017af8f0465550fe6184763b7/helios-language-server-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-13 13:18:00",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "helios-language-server"
}
        
et
Elapsed time: 0.02742s