fix: modify gopls for completion

This commit is contained in:
2024-05-08 20:20:43 +08:00
parent 2a68d143a8
commit 22b880e642
6 changed files with 59 additions and 85 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ end
return {
{
"nvim-cmp",
"hrsh7th/nvim-cmp",
enable = false,
dependencies = {
"hrsh7th/cmp-emoji",
+22 -27
View File
@@ -117,37 +117,32 @@ return {
},
},
gopls = {
setup = {
cmd = { "gopls", "serve" }, -- use cmd in path, I can update it easily
settings = {
gopls = {
analyses = {
nilness = true,
unusedparams = true,
unusedwrite = true,
useany = true,
},
staticcheck = false
}
cmd = { "gopls", "serve" }, -- use cmd in path, I can update it easily
settings = {
gopls = {
analyses = {
nilness = true,
unusedparams = true,
unusedwrite = true,
useany = true,
},
root_dir = require 'lspconfig'.util.root_pattern(".git", "go.mod", "go.work"),
init_options = { usePlaceholders = true, completeUnimported = true },
staticcheck = false,
usePlaceholders = false,
}
},
},
pylsp = {
setup = {
cmd = { "pylyzer", "--server" },
filetypes = { "python" },
settings = {
python = {
checkOnType = false,
diagnostics = false,
inlayHints = true,
smartCompletion = true
}
},
single_file_support = true,
}
cmd = { "pylyzer", "--server" },
filetypes = { "python" },
settings = {
python = {
checkOnType = false,
diagnostics = false,
inlayHints = true,
smartCompletion = true
}
},
single_file_support = true,
}
},
setup = {},