Skip to content

🛠️ Language Server for gringo (Answer Set Programming)

License

Notifications You must be signed in to change notification settings

lcian/gringo-language-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gringo-language-server

This is an LSP server for the gringo (clasp, Answer Set Programming) language.

It provides errors, warnings and code completion.

Installation (Neovim)

  1. install Rust: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

  2. install this LSP server: cargo install --git https://github.com/lcian/gringo-language-server

  3. add the following code to your init.lua:

vim.filetype.add({
    extension = {
        lp = "gringo"
    }
})

local name = "gringo-language-server"
local client = vim.lsp.start_client {
    name = name,
    cmd = { name },
}
if not client then
    vim.notify ("Something went wrong when starting " .. name)
    return
end

vim.api.nvim_create_autocmd("FileType", {
    pattern = "gringo",
    callback = function ()
        vim.lsp.buf_attach_client(0, client)
    end,
})

Releases

No releases published

Packages

No packages published

Languages