nolanderc / glsl_analyzer

Language server for GLSL (autocomplete, goto-definition, formatter, and more)
GNU General Public License v3.0
157 stars 3 forks source link

Setup with neovim #51

Closed Niwol closed 6 months ago

Niwol commented 6 months ago

Hello, I am struggling with setting up glsl_analyzer with neovim. I've followed the instructions in the README.md: I installed it via source code and put the build directory in the PATH and this seems to work

Screenshot from 2023-12-28 09-44-00

I then added this in my neovim config:

-- glsl
require'lspconfig'.glsl_analyzer.setup{
    on_attach = function()
        print("attached")
    end
}

However this does not print "attached" when i open an .vert or .frag file and there is no syntax highlight or completion proposition other than from the buffer.

Screenshot from 2023-12-28 09-38-16

Does anyone know a solution to my problem ? I am using: Ubuntu 22.04.3 LTS neovim: NVIM v0.10.0-dev-1412+g1094d0c0d

nolanderc commented 6 months ago

Hi!

This is probably due to missing a filetype for glsl. Try either running set filetype=glsl or install this syntax highlighting plugin which should to this automatically: https://github.com/tikhomirov/vim-glsl.

If this works for you, we may want to add a note in the README.

Niwol commented 6 months ago

It works for me with set filetype=glsl. Thank you.

biskwikman commented 4 months ago

Hello, just wanted to say that I had the same issue and it was fixed with the vim-glsl plugin recommended above. Using lazy nvim.