Add action to add a type annotation
See original GitHub issueWhat we want
We will make it so that the “clear” / “change” action, when applied to “type”, if there is no existing type annotation, will insert a :
and leave the cursor afterwords so that the user can add a type.
For example:
function foo() {
return "hello" // cursor at end of this line
}
User says “change type”, results in
function foo(): <cursor-here> {
return "hello"
}
Implementation
We will leverage https://github.com/pokey/cursorless-vscode/issues/210 to make it so that target returned from “type” knows how to insert itself
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (10 by maintainers)
Top Results From Across the Web
Understanding type annotation in Python - LogRocket Blog
This tutorial will explore type hints and how you can add them to your Python code. It will focus on the mypy static...
Read more >Type annotation for Immutable.js Map when passing to Redux ...
I've been slowly adding Flow type annotations to a small Redux application. However, I'm stuck on adding an annotation for the state in...
Read more >Actions - Documentation - Demo Kit - SAPUI5 SDK
Actions in the Table Toolbar. annotation-based. depends (see linked topics). List Report. Object Page. Adding Actions to Tables. Generic Action Buttons in ...
Read more >Quick Fix Add "Optional" to Type Annotation doesn't work #1873
Environment data Language Server version: v2021.9.3 OS and version: Win10, 19043.1237 Python version (& distribution if applicable, ...
Read more >Type hinting in PyCharm - JetBrains
Select a code element. · Press Alt+Enter . · Select Add type hint for .... · Press Enter to complete the action or...
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
When the action is called
change
it makes perfect sense. As aclear
command I’m a bit ambivalent. Also adding a new action for this very niche case is probably unnecessary.Yes if the action is going to be change on even add the action name is definitely incorrect