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

Allow Tab to enumerate scopes in syntax_test files #383

Open
nk9 opened this issue Dec 14, 2022 · 0 comments
Open

Allow Tab to enumerate scopes in syntax_test files #383

nk9 opened this issue Dec 14, 2022 · 0 comments

Comments

@nk9
Copy link

nk9 commented Dec 14, 2022

This is a proposal to change Tab to enumerate the available scopes in syntax_test files. It would work like repeatedly pressing ^ does for meta scopes, but instead of selecting successively larger scopes, it would move the auto-generated assertion to the next available substring.

Consider this example, with the cursor at |:

a = myfunc("str", var) + "aa"
#         ^^^^^^^^^^^^ meta.function-call.arguments.python
#|                   @ % $$$$

With Tab working as it does today, pressing Tab in this circumstance would create a single-character assertion at %. The scopes are selected. If you press Tab again, the scopes are replaced with some number of spaces, which is useless. You'd never want spaces after the set of carets.

In this proposal, pressing Tab in this situation would move the assertion to $$$$. The carets would be moved and resized, and the scopes would be rewritten. Also, pressing Shift+Tab would move the assertion BACK to the close paren (@).

This behavior would only happen AFTER Tab was first used to auto-generate an assertion. That means that Shift+Tab would still be available to insert spaces on an empty line for manually aligning an assertion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants