Neovim plugin for the Semantic Web Language Server.
Provides filetype detection for Turtle, SPARQL, and JSON-LD files and starts the LSP automatically.
- Filetype detection for
.ttl,.sq,.rq,.sparql,.jsonld - Auto-starts
swlson matching buffers - Inlay hints enabled by default
:checkhealth swlsto verify your setup
- Neovim 0.10+
swlsbinary on yourPATH
Install the binary via Cargo:
cargo install --git https://github.com/SemanticWebLanguageServer/swls.git swlsOr download a pre-built binary from the releases page.
lazy.nvim
{
"SemanticWebLanguageServer/swls.nvim",
opts = {},
}packer.nvim
use {
"SemanticWebLanguageServer/swls.nvim",
config = function()
require("swls").setup()
end,
}Manual — clone into your packpath:
git clone https://github.com/SemanticWebLanguageServer/swls.nvim \
~/.local/share/nvim/site/pack/plugins/start/swls.nvimThen call require("swls").setup() in your config.
setup() accepts an optional table. All fields are optional — unset fields keep their defaults.
require("swls").setup({
-- Command used to start the server.
cmd = { "swls" },
-- Filetypes that trigger the LSP.
filetypes = { "turtle", "sparql", "jsonld" },
-- Root directory passed to the LSP. Defaults to cwd.
root_dir = nil,
-- Sent to the server at startup. Disable languages you don't use.
init_options = {
sparql = false, -- SPARQL support is experimental
-- turtle = false,
-- jsonld = false,
},
-- Extra settings (sent via workspace/didChangeConfiguration).
settings = {},
-- Enable inlay hints on attach.
inlay_hints = true,
})Run with RUST_BACKTRACE for debugging:
require("swls").setup({
cmd = { "sh", "-c", "RUST_BACKTRACE=1 swls" },
})Enable SPARQL support:
require("swls").setup({
init_options = { sparql = true },
}):checkhealth swls
Reports whether the swls binary is found, its version, and whether your Neovim supports inlay hints.