Closed perrin4869 closed 1 week ago
Can this be implemented before Neovim 0.10? Afaik the lsp.inlay_hint feature is not stable yet.
I've tried this in Neovim 0.10, and inlay hints already seem to be working. You can enable the inlay hints using vim.lsp.inlay_hints.enable(true)
. In the metals configuration, you'll have to enable some nvim-metals settings that seem to correspond with the Metals settings from the link in the OP:
settings.showInferredType = true
seems to match with inlayHints.inferredTypes.enable
and inlayHints.typeParameters.enable
settings.showImplicitArguments = true
seems to match with inlayHints.implicitArguments.enable
settings.showImplicitConversionsAndClasses = true
seems to match with inlayHints.implicitConversions.enable
There doesn't seem to be one that matches with inlayHints.hintsInPatternMatch.enable
.
Included in https://github.com/scalameta/nvim-metals/pull/689.
Adding this to the config does not seem to work for me 🤔
inlayHints = {
hintsInPatternMatch = { enable = true },
implicitArguments = { enable = true },
implicitConversions = { enable = true },
inferredTypes = { enable = true },
typeParameters = { enable = true },
}
Metals is latest.snapshot (1.3.5+118-eb2cdb82-SNAPSHOT) and scala version 2.13.12 in the build. No errors in logs either. Is there something else to be done for this to work?
Describe the feature
https://scalameta.org/metals/docs/editors/user-configuration#should-display-type-annotations-for-inferred-types Right now we get an error message:
Potential ways to implement
No response