Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for inlayHints settings #666

Closed
perrin4869 opened this issue Apr 16, 2024 · 4 comments
Closed

Add support for inlayHints settings #666

perrin4869 opened this issue Apr 16, 2024 · 4 comments

Comments

@perrin4869
Copy link

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:

[nvim-metals] "inlayHints" is not a valid setting. It will be ignored.

Potential ways to implement

No response

@KristianAN
Copy link

Can this be implemented before Neovim 0.10? Afaik the lsp.inlay_hint feature is not stable yet.

@jqno
Copy link
Contributor

jqno commented Jul 10, 2024

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.

@ckipp01
Copy link
Member

ckipp01 commented Sep 16, 2024

Included in #689.

@taras-biletskyi
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants