@@ -30,10 +30,10 @@ return {
3030 ---- -------------
3131 -- LSP Servers --
3232 ---- -------------
33- -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations .md
33+ -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs .md
3434
35- -- LSPs with default configurations
36- local default_lsps = {
35+ -- LSPs
36+ local enabled_lsps = {
3737 " clangd" ,
3838 " pyright" ,
3939 " dockerls" ,
@@ -51,103 +51,15 @@ return {
5151 " nim_langserver" ,
5252 " terraformls" ,
5353 " erlangls" ,
54+ " eslint" ,
55+ " gopls" ,
56+ " yamlls" ,
57+ " lua_ls" ,
5458 }
5559
56- for _ , name in ipairs (default_lsps ) do
60+ for _ , name in ipairs (enabled_lsps ) do
5761 vim .lsp .enable (name )
5862 end
59-
60- -- LSPs with custom configurations
61- vim .lsp .config (' eslint' , {
62- cmd = { " vscode-eslint-languageserver" , " --stdio" }
63- })
64- vim .lsp .enable (' eslint' )
65-
66- vim .lsp .config (' gopls' , {
67- -- cmd = { vim.fn.getenv("HOME") .. "/go/bin/gopls" },
68- settings = {
69- gopls = {
70- hints = {
71- assignVariableTypes = true ,
72- compositeLiteralFields = true ,
73- compositeLiteralTypes = true ,
74- constantValues = true ,
75- functionTypeParameters = true ,
76- parameterNames = true ,
77- rangeVariableTypes = true
78- },
79- gofumpt = true ,
80- staticcheck = true ,
81- usePlaceholders = false ,
82- semanticTokens = true ,
83- directoryFilters = { " -.git" , " -.vscode" , " -.idea" , " -.vscode-test" , " -node_modules" },
84- codelenses = {
85- gc_details = true ,
86- generate = true ,
87- regenerate_cgo = true ,
88- run_govulncheck = true ,
89- test = true ,
90- tidy = true ,
91- upgrade_dependency = true ,
92- vendor = true ,
93- },
94- -- https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md
95- analyses = {
96- staticcheck = true ,
97- shadow = true ,
98- },
99- },
100- },
101- })
102- vim .lsp .enable (' gopls' )
103-
104- -- https://github.com/redhat-developer/yaml-language-server
105- vim .lsp .config (' yamlls' , {
106- settings = {
107- yaml = {
108- schemas = {
109- [" https://json.schemastore.org/github-workflow.json" ] = " /.github/workflows/*" ,
110- [" /home/dozy/projects/ika/config/schema.json" ] = " ika.yaml" ,
111- -- ["/home/dozy/projects/ika/config/schema.json"] = "ika.example.yaml",
112- },
113- format = {
114- enable = true ,
115- bracketSpacing = true
116- },
117- schemaStore = {
118- enable = true
119- }
120- },
121- },
122- })
123- vim .lsp .enable (' yamlls' )
124-
125- vim .lsp .config (' lua_ls' , {
126- on_init = function (client )
127- local path = client .workspace_folders [1 ].name
128- if vim .uv .fs_stat (path .. ' /.luarc.json' ) or vim .uv .fs_stat (path .. ' /.luarc.jsonc' ) then
129- return
130- end
131- client .config .settings .Lua = vim .tbl_deep_extend (' force' , client .config .settings .Lua , {
132- workspace = {
133- checkThirdParty = false ,
134- library = {
135- vim .env .VIMRUNTIME
136- }
137- -- This pulls in a lot or more files
138- -- library = vim.api.nvim_get_runtime_file("", true)
139- }
140- })
141- end ,
142- settings = {
143- Lua = {
144- runtime = {
145- version = ' LuaJIT'
146- },
147- }
148- }
149- })
150- vim .lsp .enable (' lua_ls' )
15163 end ,
15264 cond = function ()
15365 return not vim .g .vscode
0 commit comments