Open Gavinok opened 8 months ago
This is what I use in my init.el to get inlay hints in go files, maybe it could be of help to what you're trying to do
(lsp-register-custom-settings
'(("gopls.hints" ((assignVariableTypes . t)
(compositeLiteralFields . t)
(compositeLiteralTypes . t)
(constantValues . t)
(functionTypeParameters . t)
(parameterNames . t)
(rangeVariableTypes . t)))))
Also fyi currently there is a bug in lsp-mode where if you have this set in your early-init.el
(setenv "LSP_USE_PLISTS" "true")
(setq lsp-use-plists t)
then despite registering the settings with lsp-register-custom-settings
you will still get the error message that inlay hints are not supported by the connected server (See #4325). So that also might possibly be the cause of the error
I tried implementing this myself but had no luck adding this to the lsp-mode code base but from what I can see from lsp-go.el it's simply adding a
("gopls.hints" lsp-go-hints)
tolsp-register-custom-settings
and a definition similar to:https://github.com/golang/tools/blob/master/gopls/doc/settings.md#inlayhint
Describes the functionality however no matter what I have tried I still get this error after enabling
lsp-inlay-hints-mode