-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to config language servers like glsl-analyzer
which is not managed by mason.nvim
?
#1149
Comments
bruh, did u state those LS in the config or install them manually yet? |
i only use |
i not familiar with
Since |
I found this in the README of glsl_analyzer, but I don't know how to add it to nvimdots. I don't want to modify the default init.lua I have installed glsl-analyzer and confirmed that it is functional. Also, I added the 'glsl_analyzer' option to ['lsp_deps'] in settings.lua. |
Since u also need to make a custom lspconfig entry for nvimdots/lua/modules/configs/completion/lsp.lua Lines 9 to 17 in b0513aa
|
like this? if vim.fn.executable("glsl-analyzer") == 1 then
local glsl_opts = {
-- 在这里放置 glsl-analyzer 的特定配置选项
}
local final_glsl_opts = vim.tbl_deep_extend("keep", glsl_opts, opts)
nvim_lsp.glsl_analyzer.setup(final_glsl_opts)
end |
yeap |
can u call glsl-analyzer from any path? or just the folder where u installed it? or can u show us your whole config? |
i can call glsl-analyzer any path. |
Also, I found that glsl-analyzer seems to require the vim-glsl plugin, but even after installing the vim-glsl plugin, it's not effective. |
Oh, I think I understand now. vim-glsl is written in Vimscript, and it requires running the following statement:path " Language: OpenGL Shading Language
" Maintainer: Sergii Tykhomyrov <[email protected]>
" Extensions supported by Khronos reference compiler (with one exception, ".glsl")
" https:/KhronosGroup/glslang
autocmd! BufNewFile,BufRead *.vert,*.tesc,*.tese,*.glsl,*.geom,*.frag,*.comp,*.rgen,*.rmiss,*.rchit,*.rahit,*.rint,*.rcall set filetype=glsl
" vim:set sts=2 sw=2 : And my |
local nvim_lsp = require("lspconfig")
local opts = {
capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()),
}
-- Setup lsps that are not supported by `mason.nvim` but supported by `nvim-lspconfig` here.
if vim.fn.executable("glsl_analyzer") == 1 then
local ok, _opts = pcall(require, "user.configs.lsp-servers.glsl_analyzer")
if ok then
local final_opts = vim.tbl_deep_extend("keep", _opts, opts)
nvim_lsp.glsl_analyzer.setup(final_opts)
end
end
return {
default_config = {
cmd = { "glsl_analyzer" },
filetypes = { "glsl", "vert", "tesc", "tese", "frag", "geom", "comp" },
single_file_support = true,
},
docs = {
description = [[
https:/nolanderc/glsl_analyzer
Language server for GLSL
]],
},
}
local lang = {}
lang["tikhomirov/vim-glsl"] = {
lazy = true,
ft = { "glsl", "vert", "tesc", "tese", "frag", "geom", "comp" },
}
return lang then all be fine.
|
damn @ayamir that's what i'm drafting lol. |
glsl-analyzer
which is not managed by mason.nvim
?
glsl-analyzer
which is not managed by mason.nvim
?glsl-analyzer
which is not managed by mason.nvim
?
This is so cool! Thank you for your help! |
Version confirmation
Following prerequisites
Neovim version
NVIM v0.9.5
Branch info
main (Default/Latest)
Minimal (user) folder structure required to reproduce the issue
Minimal config with steps on how to reproduce the issue
this the config on user/configs/lsp-servers/glsl-analyzer.lua
this the config on user/configs/lsp-servers/glslls.lua
Expected behavior
the config file seem not to be loaded
Additional information
this is
:LspInfo
The text was updated successfully, but these errors were encountered: