| Crates.io | grug-ls |
| lib.rs | grug-ls |
| version | 0.1.2 |
| created_at | 2025-09-17 03:09:31.975884+00 |
| updated_at | 2025-09-21 17:14:50.491262+00 |
| description | A Language Server for the grug language |
| homepage | |
| repository | https://github.com/xijnim/grug-ls.git |
| max_upload_size | |
| id | 1842712 |
| size | 107,200 |
A Language server for grug
First clone the repo, and cd into it
git clone git@github.com:xijnim/grug-ls.git
cd grug-ls
Then create a file called "log_path" and add to it the place you wanna store the log files. Example:
echo "$HOME/Projects/grug-ls > log_path
Then build the project
cargo build
After that, the process is editor specific on how to add a language server
Using lspconfig, you can simply add this code to your init.lua
local util = require('lspconfig.util')
require('lspconfig.configs').grug = {
default_config = {
cmd = { '<insert-the-path-for-your-grug-ls-here>' },
filetypes = { 'grug' },
single_file_support = false,
root_dir = function(fname)
return util.search_ancestors(fname, function(path)
if util.path.is_file(util.path.join(path, 'mod_api.json')) then
return path
end
end)
end,
},
docs = {
description = [[
https://github.com/xijnim/grug-ls
Language server for Grug.
]],
},
}
Then you can use setup the lsp like you would any other:
require("lspconfig").grug.setup({
on_attach = on_attach,
capabilities = capabilities,
})