Replies: 2 comments
-
I like the idea of just typing a curly bracket inside a string to convert it to an f-string, as long as this is pushed to the undo stack and I can Cmd-Z quickly to undo it. I type literal curly brackets in my strings infrequently enough it wouldn't bug me much (no more than other kinds of quote/bracket auto-complete). I think the best way to do this would be to trigger on
Plus two heuristics for avoiding conversion of strings that are formatted with
|
Beta Was this translation helpful? Give feedback.
-
Moved to https://github.com/microsoft/vscode-python/issues/16989 |
Beta Was this translation helpful? Give feedback.
-
I waste so many keystrokes by starting a string, realizing I want to format an object in the middle of it, skipping back to the beginning to prepend
f
, then returning to my typing position.It'd be awesome if there was a keyboard shortcut for this, or, even better, if the need for an f-string could be automatically detected (e.g., the presence of curly braces and an in-scope object is referenced).
Beta Was this translation helpful? Give feedback.
All reactions