Compare commits

...
Author SHA1 Message Date
l0ng-ai 322f6b3d9d 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.
2026-11-20 20:16:17 +08:00
+1 -1
View File
@@ -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"