svenstaro / glsl-language-server

Language server implementation for GLSL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using with neovim

callumacrae opened this issue · comments

Hey! Trying to figure out how to get this working with neovim's native LSP functionality but I'm getting the following error:

Client 1 quit with exit code 0 and signal 6

And in the log:

[ERROR][2021-11-11 17:12:22] .../vim/lsp/rpc.lua:462	"rpc"	"glslls"	"stderr"	"libc++abi: terminating with uncaught exception of type std::invalid_argument: Unknown file extension!\n"

Is this an issue with my setup or with the language server?

Here's my config for nvim-lspconfig if that helps:

configs.glsl = {
  default_config = {
    cmd = { 'glslls', '--stdin' },
    filetypes = { 'glsl' },
    root_dir = util.root_pattern('.git'),
    single_file_support = true,
  },
};

See here for supported file extensions: https://github.com/svenstaro/glsl-language-server/blob/master/src/main.cpp#L49-L61

It's important for the language server to be able to figure out the right shader program so you have to be specific as to what kind of what this actually is.

That makes total sense, thank you!

commented

Did you manage to get this to work?
I tried copying the same thing you put in, but it still doesn't work.

I get Client 1 quit with exit code 109 and signal 0

I forgot to mention that I did the same config with the proper .vs, .fs and .gs, and the rest

Ok, so I think I managed to bang my head against the wall enough to get it working, even if a bit broken.
It works when it wants to, and I get an error Error detected while processing VimLeavePre Autocommands for "*":, but it actually seems to work. I'll leave it at this for now.