Consider enabling type & parameter hints by default
See original GitHub issueIt’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:
- Created a year ago
- Reactions:3
- Comments:9 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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:
…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.That seems to be the case. I was referring to the inlay hints default.