question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider enabling type & parameter hints by default

See original GitHub issue

It’s a bit hard to discover that they exist! As a case point, I (of all the people 😃 ) spend yesterday’s evening wishing for them to exist, only to realize this morning, after reading rel-notes, that they do in fact exist, just not enabled by default.

There’s two helpful guidelines here:

  • by default, it makes sense to enable features, as it is much easier to disable annoying feature than to enable the feature you’d love, but don’t realize exists
  • there’s editor-global setting "editor.inlayHints.enabled", and extensions should generally honor that. It’s on for me (and by default I guess), so I have the expectation of inlay hints showing up, if they exist

On the first point, my long-term unrealized wish for rust-analyzer is to have to settings “profiles”: default, which enables everything and makes the editor glow like a Christmas tree, and a recommended profile, with a more no-frills config I’d actually use. The intention here is that new users don’t miss features, while pro users get a good config without needing to know about every setting.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
dsherretcommented, Dec 14, 2022

I personally dislike it as well, but it seems like the majority of people like it. The vscode default is for it to be on so I think it makes sense for us to follow and honour that.

Note to others, you can easily disable it by adding:

{
  // etc...
   "editor.inlayHints.enabled": "off"
}

…to your vscode user settings.json (hit f1 key, then search for Preferences: Open User Settings (JSON)). Or otherwise go to File > Preferences > Settings, then search for “Inlay hints” and turn it off.

2reactions
dsherretcommented, Dec 15, 2022

That seems to be the case. I was referring to the inlay hints default.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does a default parameters overwrite type hints for mypy?
When you make a keyword argument accept None , mypy will implicitly make that argument be of type Optional[Blah] if it isn't already....
Read more >
Inlay hints | JetBrains Rider Documentation
When your caret is at a code item that has an inlay hint, you can press Alt+Enter , choose Configure Inlay Name Hints,...
Read more >
Unable to specify a default value for a generic parameter #3737
Another solution is to use a broad static type for that parameter and immediately assign it in the body to the original exact...
Read more >
Code Better With Type Hints – Part 3 - PyBites
It is best practice to initialize optional parameters with a default value of None so you can check against None before you use...
Read more >
typing — Support for type hints — Python 3.11.1 documentation
In the function greeting , the argument name is expected to be of type str and the return type str . Subtypes are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found