@@ -72,10 +72,8 @@ local filetype_attach = setmetatable({
7272 end ,
7373
7474 typescript = function ()
75- autocmd_format (false , function (clients )
76- return vim .tbl_filter (function (client )
77- return client .name ~= " tsserver"
78- end , clients )
75+ autocmd_format (false , function (client )
76+ return client .name ~= " tsserver"
7977 end )
8078 end ,
8179}, {
@@ -144,7 +142,7 @@ local custom_attach = function(client)
144142 ]]
145143 end
146144
147- if client .server_capabilities .codeLensProvider then
145+ if false and client .server_capabilities .codeLensProvider then
148146 if filetype ~= " elm" then
149147 vim .cmd [[
150148 augroup lsp_document_codelens
@@ -173,13 +171,17 @@ updated_capabilities.textDocument.completion.completionItem.insertReplaceSupport
173171-- vim.lsp.buf_request(0, "textDocument/codeLens", { textDocument = vim.lsp.util.make_text_document_params() })
174172
175173local servers = {
174+
175+ -- Also uses `shellcheck` and `explainshell`
176+ bashls = true ,
177+
178+ eslint = true ,
176179 gdscript = true ,
177- graphql = true ,
180+ -- graphql = true,
178181 html = true ,
179182 pyright = true ,
180183 vimls = true ,
181184 yamlls = true ,
182- eslint = true ,
183185
184186 cmake = (1 == vim .fn .executable " cmake-language-server" ),
185187 dartls = pcall (require , " flutter-tools" ),
@@ -200,18 +202,18 @@ local servers = {
200202 },
201203
202204 gopls = {
203- root_dir = function (fname )
204- local Path = require " plenary.path"
205-
206- local absolute_cwd = Path :new (vim .loop .cwd ()):absolute ()
207- local absolute_fname = Path :new (fname ):absolute ()
208-
209- if string.find (absolute_cwd , " /cmd/" , 1 , true ) and string.find (absolute_fname , absolute_cwd , 1 , true ) then
210- return absolute_cwd
211- end
212-
213- return lspconfig_util .root_pattern (" go.mod" , " .git" )(fname )
214- end ,
205+ -- root_dir = function(fname)
206+ -- local Path = require "plenary.path"
207+ --
208+ -- local absolute_cwd = Path:new(vim.loop.cwd()):absolute()
209+ -- local absolute_fname = Path:new(fname):absolute()
210+ --
211+ -- if string.find(absolute_cwd, "/cmd/", 1, true) and string.find(absolute_fname, absolute_cwd, 1, true) then
212+ -- return absolute_cwd
213+ -- end
214+ --
215+ -- return lspconfig_util.root_pattern("go.mod", ".git")(fname)
216+ -- end,
215217
216218 settings = {
217219 gopls = {
@@ -230,11 +232,11 @@ local servers = {
230232
231233 rust_analyzer = {
232234 cmd = { " rustup" , " run" , " nightly" , " rust-analyzer" },
235+ -- cmd = { "rust-analyzer" },
233236 },
234237
235238 elmls = true ,
236239 cssls = true ,
237-
238240 tsserver = {
239241 init_options = ts_util .init_options ,
240242 cmd = { " typescript-language-server" , " --stdio" },
@@ -369,13 +371,6 @@ for server, config in pairs(servers) do
369371 setup_server (server , config )
370372end
371373
372- if pcall (require , " sg.lsp" ) then
373- require (" sg.lsp" ).setup {
374- on_init = custom_init ,
375- on_attach = custom_attach ,
376- }
377- end
378-
379374-- [ An example of using functions...
380375-- 0. nil -> do default (could be enabled or disabled)
381376-- 1. false -> disable it
0 commit comments