⚡Qlue-ls (pronounced "clueless") is a blazingly fast language server for SPARQL, written in Rust 🦀.
[!CAUTION] This Project is still in an early stage.
Only the format capability is production ready.
The rest is experimental.
Getting Started
Installation
Qlue-ls is available on crate.io:
cargo install qlue-ls
And on PyPi:
pipx install qlue-ls
You can also build it from source:
git clone https://github.com/IoannisNezis/Qlue-ls.git
cd Qlue-ls
cargo build --release --bin qlue-ls
Usage
To run qlue-ls as formatter run:
qlue-ls format <PATH>
To run qlue-ls as lanugage server run:
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:
vim..
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
[]
= true
= false
= false
= true
= true
= 2
= false
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:
npm i qlue-ls
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...
Special Thanks
- TJ DeVries for the inspiration and great tutorials
- Chris Biscardi for teaching me Rust
- GordianDziwis for providing a sparql-tree-sitter grammar