feat: convert to blink, major lsp changes, lualine
This commit is contained in:
parent
82102e5e29
commit
51ab444c0d
44 changed files with 1387 additions and 700 deletions
45
lua/lsp/gopls.lua
Normal file
45
lua/lsp/gopls.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
local tools = require 'utils.tools'
|
||||
|
||||
-- Get LSP capabilities with cmp support
|
||||
local capabilities = tools.get_lsp_capabilities()
|
||||
|
||||
-- Setup gopls LSP using autocmd
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'go',
|
||||
callback = function()
|
||||
local gopls_path = tools.find_executable 'gopls'
|
||||
|
||||
if gopls_path then
|
||||
vim.lsp.start {
|
||||
name = 'gopls',
|
||||
cmd = { gopls_path },
|
||||
root_dir = vim.fs.dirname(vim.fs.find({ 'go.mod', 'go.work', '.git' }, { upward = true })[1]),
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
gofumpt = true,
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
experimentalPostfixCompletions = true,
|
||||
hints = {
|
||||
assignVariableTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
constantValues = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Return empty config since we handle gopls LSP manually via autocmd above
|
||||
return {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue