qlue-ls


Nameqlue-ls JSON
Version 0.1.16 PyPI version JSON
download
home_pageNone
SummaryA formatter for SPARQL queries
upload_time2024-12-16 11:10:52
maintainerNone
docs_urlNone
authorIoannis Nezis <ioannis@nezis.de>
requires_python>=3.8
licenseMIT
keywords sparql formatter lsp wasm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            > [!CAUTION]
> This Project is still in an early stage.  
> Only the format capability is production ready.  
> The rest is experimental.

<h1 align="center">
  Qlue-ls 🦀
</h1>

⚡Qlue-ls (pronounced "clueless") is a blazingly fast [language server](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification) for [SPARQL](https://de.wikipedia.org/wiki/SPARQL), written in Rust 🦀.

# Getting Started

## Installation

Qlue-ls is available on [crate.io](https://crates.io/crates/qlue-ls):

```shell
cargo install qlue-ls
```

And on [PyPi](https://pypi.org/project/qlue-ls/):

```shell
pipx install qlue-ls
```

You can also build it from source:

```shell
git clone https://github.com/IoannisNezis/sparql-language-server.git
cd sparql-language-server
cargo build --release --bin qlue-ls
```

## Usage

To run qlue-ls as **formatter** run:

```shell
qlue-ls format <PATH>
```

To run qlue-ls as **lanugage server** run:

```shell
qlue-ls server
```

This will create a language server listening on stdio.

## Connect to Neovim

After you installed the language server, add this to your `init.lua`:

```lua
vim.api.nvim_create_autocmd({ 'FileType' }, {
  desc = 'Connect to sparql-language-server',
  pattern = { 'sparql' },
  callback = function()
    vim.lsp.start {
      name = 'qlue-ls',
      cmd = { 'qlue-ls', 'server' },
      root_dir = vim.fn.getcwd(),
      on_attach = function(client, bufnr)
        vim.keymap.set('n', '<leader>f', vim.lsp.buf.format, { buffer = bufnr, desc = 'LSP: ' .. '[F]ormat' })
      end,
    }
  end,
})
```

Open a `.rq` file and check that the buffer is attached to th server:

```
:checkhealth lsp
```

Configure keymaps in `on_attach` function.

# Capabilities

## Formatting

**Status**: Full support

Formats SPARQL queries to ensure consistent and readable syntax.
Customizable options to align with preferred query styles are also implemented.

## Diagnostics

**Status**: Partial support

Currently provides a few basic diagnostics for syntax errors and simple issues in SPARQL queries.
Further enhancements are planned to cover a broader range of semantic and logic-related diagnostics.

**Currently provided diagnostics**:

- unused namespace (warning): A declared namespace is not used
- undefined namespace (error): A used namespace is not declared

**Planed diagnostics**:

- path compresion possible (info): A declared namespace is not used

## Completion

**Status**: Rudimentary

Basic auto-completion for SPARQL keywords and variables. Currently not context aware.  
Future improvements will expand suggestions to include functions, predicates, and custom completions based on query context.

## Code Actions

**Status**: Planed

Future support for code actions, such as quick fixes and refactoring suggestions, to improve productivity and code quality in SPARQL development.

**Planed code actions**:

- Consolidate property paths
- Refactor iris into namespaces
- Sort Prefixes

# Configuration

qlue-ls can be configured through a `qlue-ls.toml` or `qlue-ls.yml` file.

Here is the full default configuration
```toml
[format]
align_predicates = false
align_prefixes = false
separate_prolouge = true
capitalize_keywords = true
insert_spaces = true
tab_size = 2
where_new_line = true
```

# use in web

If you want to connect from a web-based-editor, you can use this package as well.  
For this purpouse this can be compiled to wasm and is availible on [npm](https://www.npmjs.com/package/@ioannisnezis/sparql-language-server):


```shell
npm i @ioannisnezis/sparql-language-server
```

You will have to wrap this in a Web Worker and provide a language server client.
There will be more documentation on this in the future...

## Demo

In the mean time, check out the [demo](https://sparql.nezis.de).


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "qlue-ls",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "SPARQL, formatter, lsp, wasm",
    "author": "Ioannis Nezis <ioannis@nezis.de>",
    "author_email": "Ioannis Nezis <ioannis@nezis.de>",
    "download_url": "https://files.pythonhosted.org/packages/0f/5e/a8cb5357bc88d3cc70e78bae2eee0e25e68b14b01818464186733b047093/qlue_ls-0.1.16.tar.gz",
    "platform": null,
    "description": "> [!CAUTION]\n> This Project is still in an early stage.  \n> Only the format capability is production ready.  \n> The rest is experimental.\n\n<h1 align=\"center\">\n  Qlue-ls \ud83e\udd80\n</h1>\n\n\u26a1Qlue-ls (pronounced \"clueless\") is a blazingly fast [language server](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification) for [SPARQL](https://de.wikipedia.org/wiki/SPARQL), written in Rust \ud83e\udd80.\n\n# Getting Started\n\n## Installation\n\nQlue-ls is available on [crate.io](https://crates.io/crates/qlue-ls):\n\n```shell\ncargo install qlue-ls\n```\n\nAnd on [PyPi](https://pypi.org/project/qlue-ls/):\n\n```shell\npipx install qlue-ls\n```\n\nYou can also build it from source:\n\n```shell\ngit clone https://github.com/IoannisNezis/sparql-language-server.git\ncd sparql-language-server\ncargo build --release --bin qlue-ls\n```\n\n## Usage\n\nTo run qlue-ls as **formatter** run:\n\n```shell\nqlue-ls format <PATH>\n```\n\nTo run qlue-ls as **lanugage server** run:\n\n```shell\nqlue-ls server\n```\n\nThis will create a language server listening on stdio.\n\n## Connect to Neovim\n\nAfter you installed the language server, add this to your `init.lua`:\n\n```lua\nvim.api.nvim_create_autocmd({ 'FileType' }, {\n  desc = 'Connect to sparql-language-server',\n  pattern = { 'sparql' },\n  callback = function()\n    vim.lsp.start {\n      name = 'qlue-ls',\n      cmd = { 'qlue-ls', 'server' },\n      root_dir = vim.fn.getcwd(),\n      on_attach = function(client, bufnr)\n        vim.keymap.set('n', '<leader>f', vim.lsp.buf.format, { buffer = bufnr, desc = 'LSP: ' .. '[F]ormat' })\n      end,\n    }\n  end,\n})\n```\n\nOpen a `.rq` file and check that the buffer is attached to th server:\n\n```\n:checkhealth lsp\n```\n\nConfigure keymaps in `on_attach` function.\n\n# Capabilities\n\n## Formatting\n\n**Status**: Full support\n\nFormats SPARQL queries to ensure consistent and readable syntax.\nCustomizable options to align with preferred query styles are also implemented.\n\n## Diagnostics\n\n**Status**: Partial support\n\nCurrently provides a few basic diagnostics for syntax errors and simple issues in SPARQL queries.\nFurther enhancements are planned to cover a broader range of semantic and logic-related diagnostics.\n\n**Currently provided diagnostics**:\n\n- unused namespace (warning): A declared namespace is not used\n- undefined namespace (error): A used namespace is not declared\n\n**Planed diagnostics**:\n\n- path compresion possible (info): A declared namespace is not used\n\n## Completion\n\n**Status**: Rudimentary\n\nBasic auto-completion for SPARQL keywords and variables. Currently not context aware.  \nFuture improvements will expand suggestions to include functions, predicates, and custom completions based on query context.\n\n## Code Actions\n\n**Status**: Planed\n\nFuture support for code actions, such as quick fixes and refactoring suggestions, to improve productivity and code quality in SPARQL development.\n\n**Planed code actions**:\n\n- Consolidate property paths\n- Refactor iris into namespaces\n- Sort Prefixes\n\n# Configuration\n\nqlue-ls can be configured through a `qlue-ls.toml` or `qlue-ls.yml` file.\n\nHere is the full default configuration\n```toml\n[format]\nalign_predicates = false\nalign_prefixes = false\nseparate_prolouge = true\ncapitalize_keywords = true\ninsert_spaces = true\ntab_size = 2\nwhere_new_line = true\n```\n\n# use in web\n\nIf you want to connect from a web-based-editor, you can use this package as well.  \nFor this purpouse this can be compiled to wasm and is availible on [npm](https://www.npmjs.com/package/@ioannisnezis/sparql-language-server):\n\n\n```shell\nnpm i @ioannisnezis/sparql-language-server\n```\n\nYou will have to wrap this in a Web Worker and provide a language server client.\nThere will be more documentation on this in the future...\n\n## Demo\n\nIn the mean time, check out the [demo](https://sparql.nezis.de).\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A formatter for SPARQL queries",
    "version": "0.1.16",
    "project_urls": {
        "Source Code": "https://github.com/IoannisNezis/sparql-language-server"
    },
    "split_keywords": [
        "sparql",
        " formatter",
        " lsp",
        " wasm"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "601e6d8a0ce93c18a9ed3a33a638c6d0d3056618ba075a7d0e2954b5991379a1",
                "md5": "731b738a9ac789019c7b33ce30f6519f",
                "sha256": "2b7935e4ed05183b6cd22dfeef5b4cb5e26ec37919de09f65f7f1690de5b20a0"
            },
            "downloads": -1,
            "filename": "qlue_ls-0.1.16-py3-none-manylinux_2_34_x86_64.whl",
            "has_sig": false,
            "md5_digest": "731b738a9ac789019c7b33ce30f6519f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 2123416,
            "upload_time": "2024-12-16T11:10:49",
            "upload_time_iso_8601": "2024-12-16T11:10:49.593821Z",
            "url": "https://files.pythonhosted.org/packages/60/1e/6d8a0ce93c18a9ed3a33a638c6d0d3056618ba075a7d0e2954b5991379a1/qlue_ls-0.1.16-py3-none-manylinux_2_34_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0f5ea8cb5357bc88d3cc70e78bae2eee0e25e68b14b01818464186733b047093",
                "md5": "82ec7b7f425a8000fe4733006b4f3729",
                "sha256": "a32a411abd81ce78d648b1bfe31c51907c40e30164878d9ed8cb3acfaec17f5e"
            },
            "downloads": -1,
            "filename": "qlue_ls-0.1.16.tar.gz",
            "has_sig": false,
            "md5_digest": "82ec7b7f425a8000fe4733006b4f3729",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 54399,
            "upload_time": "2024-12-16T11:10:52",
            "upload_time_iso_8601": "2024-12-16T11:10:52.098881Z",
            "url": "https://files.pythonhosted.org/packages/0f/5e/a8cb5357bc88d3cc70e78bae2eee0e25e68b14b01818464186733b047093/qlue_ls-0.1.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-16 11:10:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "IoannisNezis",
    "github_project": "sparql-language-server",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "qlue-ls"
}
        
Elapsed time: 0.44010s