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

Hide some Inlay Hints #924

Closed
Booksbaum opened this issue Apr 19, 2022 · 2 comments · Fixed by #932
Closed

Hide some Inlay Hints #924

Booksbaum opened this issue Apr 19, 2022 · 2 comments · Fixed by #932

Comments

@Booksbaum
Copy link
Contributor

Though quite nice in general, there are some cases Inlay Hints are redundant or distracting:

  • variable has same name as parameter
    VariableAndNameHaveSameName
  • Some commonly used functions where parameter name doesn't add anything (like not or ignore)
    NotIgnore
    • some maybes?

      • in printfn & co
        printfn
        • all sprintf & co functions are very often used -> very distracting
        • but: might be useful for newcomers (format -> wants format string)
      • in List.map & co
        ListMap
        • again: very distracting when used to, but might be a nice hint for someone new to F#

      -> maybe setting to disable some hints (-> user defined list with hints to disable? By type and or parameter name (regex?)?)

  • Very long names
    Long
    • Additional: VSCode seems to break hints apart once it reaches a certain length


How others handle inlay hints:

  • rust analyzer hides some parameter hints:
    // hide when:
    // - the parameter name is a suffix of the function's name
    // - the argument is an enum whose name is equal to the parameter
    // - exact argument<->parameter match(ignoring leading underscore) or parameter is a prefix/suffix
    //   of argument with _ splitting it off
    // - param starts with `ra_fixture`
    // - param is a well known name in a unary function
  • Rider/ReSharper: Can hide parameter hints matching a certain pattern
  • Typescript:
    • Caps length at 30
@baronfel
Copy link
Contributor

These are all really helpful suggestions, thanks for the time you took writing it up! I agree on the length, that's a really good thing to add and plumb through.

The more-specific kinds of hints might be more difficult to do, but of course we'd love to be able to offer more toggles so that people can choose the specific kind of hints they want, easily.

One other thing we should do is round-trip the configuration settings I've added in ionide around hint generation into the generation side of things here in FSAC, not just the rendering side in Ionide.

@piaste
Copy link

piaste commented Apr 26, 2022

Add to the list: unary operators

let x = 11
let y = -x

becomes:

image

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

Successfully merging a pull request may close this issue.

3 participants