Skip to content
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

Closed
jotaf98 opened this issue Feb 22, 2019 · 5 comments
Assignees
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code smart-select

Comments

@jotaf98
Copy link

jotaf98 commented Feb 22, 2019

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?

@vscodebot vscodebot bot added the editor-contrib Editor collection of extras label Feb 22, 2019
@jotaf98 jotaf98 changed the title SmartSelect: Select next/previous argument in function (to complement grow/shrink selection) [Suggestion] SmartSelect: Select next/previous argument in function (to complement grow/shrink selection) Feb 22, 2019
@jrieken jrieken added info-needed Issue requires more information from poster smart-select and removed editor-contrib Editor collection of extras labels Feb 26, 2019
@jrieken
Copy link
Member

jrieken commented Feb 26, 2019

what version of vs code is that? what language is that?

@jrieken jrieken self-assigned this Feb 26, 2019
@jotaf98
Copy link
Author

jotaf98 commented Mar 4, 2019

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.

@jrieken
Copy link
Member

jrieken commented Mar 5, 2019

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.

@jrieken jrieken added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Mar 5, 2019
@jotaf98
Copy link
Author

jotaf98 commented Mar 14, 2019

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.

@jrieken jrieken added the *out-of-scope Posted issue is not in scope of VS Code label Oct 7, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 7, 2019

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!

@vscodebot vscodebot bot closed this as completed Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code smart-select
Projects
None yet
Development

No branches or pull requests

2 participants