add go template support
This commit is contained in:
@@ -204,6 +204,12 @@ local on_attach = function(client, bufnr)
|
|||||||
end
|
end
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
require('lspconfig')['gopls'].setup{
|
require('lspconfig')['gopls'].setup{
|
||||||
|
settings = {
|
||||||
|
gopls = {
|
||||||
|
templateExtensions = {'gotmpl', 'gohtml'},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filetypes = { "go", "gomod", "gowork", "gotmpl", "gohtml", "gohtmltmpl" },
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
@@ -302,4 +308,9 @@ lua <<EOF
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
lua << EOF
|
lua << EOF
|
||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
gohtml = "gohtmltmpl"
|
||||||
|
}
|
||||||
|
})
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user