dotfiles/.config/nvim/fnl/config/lsp/servers.fnl
2024-03-13 15:12:40 +01:00

40 lines
1.4 KiB
Fennel

(import-macros {: setup : reqcall} :macros)
(import-macros {: merge} :core_macros)
(local setup_ls (require :config.lsp.setup_ls))
(local mason_utils (require :config.lsp.mason))
;; init servers with manual configuration
(local schemastore (require :schemastore))
(setup_ls :jsonls {:settings {:json {:validate {:enable true}
:schemas (schemastore.json.schemas)}}})
(setup_ls :yamlls {:settings {:yaml {:schemaStore {:enable true}}}})
(setup_ls :taplo {:settings {:toml {:schemas (schemastore.json.schemas)}}})
(setup_ls :jdtls {:init_options {:extendedClientCapabilities {:progressReportProvider false}}})
(setup_ls :bashls {:filetypes [:sh :zsh]})
(local globals [])
(local workspace {})
(when vim.env.MPV_LUA (table.insert globals :mp))
(when vim.env.AEGISUB_LUA (table.insert globals :aegisub))
(when vim.env.NVIM_LUA
(setup :neodev {})
(set workspace.library (vim.api.nvim_get_runtime_file "" true)))
; (setup_ls :lua_ls {:settings {:Lua {:diagnostics {:globals globals}
; :runtime {:version "LuaJIT"}
; :workspace workspace
; :telemetry {:enable false}}}})
(local servers [:clangd :pyright :tsserver :typst_lsp :gopls :ruff_lsp])
(each [_ server (ipairs servers)]
(setup_ls server))
(mason_utils.setup_installed_servers)