From 322f6b3d9d7e53cf8edd62c74fd8757edde7148c Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Fri, 20 Nov 2026 20:16:17 +0800 Subject: [PATCH] feat(go): show the values of constants as inlay hints gopls computes the value of each constant in a declaration, including iota sequences, but only reports it as an inlay hint when its constantValues hint is on. Turn it on, so Sunday Weekday = iota shows = 0 and the following constants = 1, = 2 without hovering each one. --- languages/go.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/go.toml b/languages/go.toml index cad908e226..634213381f 100644 --- a/languages/go.toml +++ b/languages/go.toml @@ -17,7 +17,7 @@ func main() { [[language-servers]] name = "gopls" command = "gopls" -initialization-options = { semanticTokens = true, vulncheck = "Imports" } +initialization-options = { semanticTokens = true, vulncheck = "Imports", hints = { constantValues = true } } root-markers = ["go.work", "go.mod"] install-hint = "go install golang.org/x/tools/gopls@latest"