Skip to content

Commit 1d00bfa

Browse files
committed
Configure inlayHints for gopls
1 parent 8f28ed5 commit 1d00bfa

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

after/lsp/gopls.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ return {
99
},
1010
staticcheck = true,
1111
gofumpt = true,
12+
-- inlayHints settings, see https://go.dev/gopls/inlayHints
13+
hints = {
14+
compositeLiteralFields = true,
15+
parameterNames = true,
16+
},
1217
},
1318
},
1419
}

lua/lsp_conf.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ vim.api.nvim_create_autocmd("LspAttach", {
8383
client.server_capabilities.hoverProvider = false
8484
end
8585

86+
-- TODO: turn this into a command to toggle dynamically
8687
-- Uncomment code below to enable inlay hint from language server, some LSP server supports inlay hint,
8788
-- but disable this feature by default, so you may need to enable inlay hint in the LSP server config.
8889
-- vim.lsp.inlay_hint.enable(true, {buffer=bufnr})

0 commit comments

Comments
 (0)