-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Suggestion] SmartSelect: Select next/previous argument in function (to complement grow/shrink selection) #69252
Comments
what version of vs code is that? what language is that? |
Hi, I'm not sure it matters much since 1) it's a feature request so it doesn't exist in any version, 2) SmartSelect is a feature that exists across all supported languages. In any case, I'm using VSCode 1.31.1 mostly for Python. |
It matters, because rewrote all of smart select in the last release. Also we have made API so that extensions can help the dump default implementation. |
Thanks for clearing that up, it was naive of me to think the version didn't matter! Reading about the SmartSelect rewrite (and the API for language-specific selections) is actually what prompted me to make this suggestion. I noticed the inclusion of parent pointers in selections in #67872, thanks for following up on this! It seems that this structure will support lots of other powerful selection functions too. |
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider. If you wonder what we are up to, please see our roadmap and issue reporting guidelines. Thanks for your understanding and happy coding! |
The grow/shrink selection shortcuts are great. However, with a (comparatively small) addition they could be used to go "anywhere" in the code, which would make them very powerful.
These two commands could be described intuitively as "next/previous selection", or "select next/previous argument".
An example, using square brackets to denote the selection. Initial selection (empty):
my_function([]a, b*c, d)
Expand selection:
my_function([a], b*c, d)
Next selection:
my_function(a, [b*c], d)
Growing/shrinking the selection can be seen as selecting the parent or child node in the AST (abstract syntax tree). Naturally, since some nodes in the AST have multiple children (e.g. a function with 3 arguments has 3 children, same with operators), if we could navigate between them we would be able to reach anywhere in the tree.
I think this hierarchical navigation could be very powerful. Thoughts?
The text was updated successfully, but these errors were encountered: