Basic setup
This commit is contained in:
parent
2ba39c6973
commit
0185a988a2
15 changed files with 412 additions and 38 deletions
64
lua/custom/plugins/go.lua
Normal file
64
lua/custom/plugins/go.lua
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
local on_attach = function(client, bufnr)
|
||||
if not client.server_capabilities.semanticTokensProvider then
|
||||
local semantic = client.config.capabilities.textDocument.semanticTokens
|
||||
client.server_capabilities.semanticTokensProvider = {
|
||||
full = true,
|
||||
legend = {
|
||||
tokenTypes = semantic.tokenTypes,
|
||||
tokenModifiers = semantic.tokenModifiers,
|
||||
},
|
||||
range = true,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
require('lspconfig').gopls.setup {
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
'leoluz/nvim-dap-go',
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
'fredrikaverpil/neotest-golang',
|
||||
},
|
||||
{
|
||||
'echasnovski/mini.icons',
|
||||
opts = {
|
||||
file = {
|
||||
['.go-version'] = { glyph = '', hl = 'MiniIconsBlue' },
|
||||
},
|
||||
filetype = {
|
||||
gotmpl = { glyph = '', hl = 'MiniIconsGrey' },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'mfussenegger/nvim-dap',
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
'leoluz/nvim-dap-go',
|
||||
opts = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'nvim-neotest/neotest',
|
||||
optional = true,
|
||||
dependencies = {
|
||||
'fredrikaverpil/neotest-golang',
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
['neotest-golang'] = {
|
||||
-- Here we can set options for neotest-golang, e.g.
|
||||
-- go_test_args = { "-v", "-race", "-count=1", "-timeout=60s" },
|
||||
dap_go_enabled = true, -- requires leoluz/nvim-dap-go
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue