You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class MyClass:
def method(self):
value = [{"key 1": "value 1"}, {...}]
return value
For instance if the cursor placed on the "y" of "key 1", iteratively pressing shift+alt+right arrow should iteratively select:
the content of the string "key 1",
the content of the dict (between { and }),
the full dict expression ({ and } included),
the content of the list (between [ and ]),
the full list expression ([ and ] included),
the value local variable assignment statement (without the indentation spaces),
the line with the value local variable assignment statement,
all the lines in the body of the method,
all the lines of the method, "def" declaration included,
all the lines of the body class,
all the lines of the class, class declaration included,
the full file.
At the moment, the smart select behavior works as expected for some of those steps but not all of them, in particular it does not understand the structure of Python strings, Python functions and classes.
Reacted by mrahim, Lode Nachtergaele, Tom Zoeller, Nilay Thakor, amrrs, Riyad Parvez, Hasan Rizvi, Giuseppe Carlino, Michal Lukac, swayson and 19 more
Olivier Grisel (@ogrisel) We don't disagree (hence why this is labeled needs spec), but it's the usual issue of simply finding the time to get to it. Plus this issue is sixth in terms of upvotes of items at the "needs spec" stage (that's ignoring issues we have not flagged to the stage of "needs spec"), so we potentially have stuff people are requesting ahead of this.
But I did make sure that it is list on our roadmap somewhere so it doesn't get lost.
Layman question: Is this just a [missing feature / issue] of specific language servers (pylance, jedi) or does it also need changes in this plugin? Thanks.
Activity
ogrisel commentedon Jan 29, 2020
Here an example of Python code:
For instance if the cursor placed on the "y" of "key 1", iteratively pressing
shift+alt+right arrowshould iteratively select:"key 1",{and}),{and}included),[and]),[and]included),valuelocal variable assignment statement (without the indentation spaces),valuelocal variable assignment statement,At the moment, the smart select behavior works as expected for some of those steps but not all of them, in particular it does not understand the structure of Python strings, Python functions and classes.
massich commentedon Jan 30, 2020
+1
kikyous commentedon Aug 10, 2020
smart select is very helpful
ogrisel commentedon Jun 28, 2021
It's been more than a year and I still think this is an important missing usability feature when editing Python code from VS Code.
brettcannon commentedon Jun 28, 2021
Olivier Grisel (@ogrisel) We don't disagree (hence why this is labeled
needs spec), but it's the usual issue of simply finding the time to get to it. Plus this issue is sixth in terms of upvotes of items at the "needs spec" stage (that's ignoring issues we have not flagged to the stage of "needs spec"), so we potentially have stuff people are requesting ahead of this.But I did make sure that it is list on our roadmap somewhere so it doesn't get lost.
WizardUli commentedon Oct 24, 2021
Layman question: Is this just a [missing feature / issue] of specific language servers (pylance, jedi) or does it also need changes in this plugin? Thanks.
brettcannon commentedon Oct 25, 2021
grawp it can technically be done either via LSP or in the extension. Specifically for LSP, it is implemented via the
selectionRangerequest. The issue in Pylance for this is microsoft/pylance-release#266 .brettcannon commentedon Jan 25, 2022
This was implemented in the 2021.12.1 release of Pylance!
microsoft/pylance-release#266