-
-
Notifications
You must be signed in to change notification settings - Fork 84
Add support for “grand” scopes #124
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
Comments
Maybe use ordinals here?
|
We're going to want those ordinals for the new grammar. "Take second funk" will take the second function in the class containing the cursor |
Okay then use super maybe? Is just don't think that |
Yeah "super" could work, tho I'm not sure it helps because "second super funk" would want to be the second "super funk" in the new grammar But yeah I agree multiple levels of nesting will be awkward as it would be "great great grand funk". Tho not sure how common it will be to want to go up more than 2 levels ("grand funk"), so from my perspective it's more important for it to be possible than compact Could do something like "two super"? Idk not sure that feels right Also we can (and maybe should?) make it so "funk" applied to a function target will expand to next higher funk rather than being idempotent, so then you could do "funk funk", which also scales like the "grand" approach but might have benefits |
* Original scope handlers * More stuff * Use proper token stage in sub token stage * Work around for identifier matcher * Use new scope handler in relative scope stage * Use new scope handlers in ordinal scope stage * Update usage of containing indices * Rename * Refactored create target * Clean up * clean up * Add some tests that should pass * Add a bunch more tests * Attempt at different approach to scope handlers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Initial implementation of new idea * More work on this stuff * Rename and add some todos * More stuff * Tweaks * Renames and docstrings * Restructuring * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * More jsdocs * Tweaks * Test fixes * Fix error messages * Revert `OrdinalScopeStage` * Tweak * jsdocs; fix import * Don't export legacy types * Fix import * Preparation for surrounding pairs * Naming cleanup * Unify `getLegacyScopeStage` functions * Lots of cleanup * Fix regex `lastIndex` issue * More cleanup * More cleanup * More cleanup * Add `ancestorIndex` in prepartion for #124 * Add more jsdocs * More docs * More docs * docstrings * Improve hierarchical error type * Docs * More minor dog tweaks * More docs * More docs * Doc strings and a couple tests * Remove `isPreferredOver` * Support `ancestorIndex` on api surface * Improved jsdocs * Split and cleanup relative stages * Make scope handler constructor args optional * More legacy type fixes * Add `"identifier"` scope * Working new code * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Docs + cheatsheet * Update docs * Add jsdoc * jsdoc * JSDocs * doc tweaks * reflow * Tweaks Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Original scope handlers * More stuff * Use proper token stage in sub token stage * Work around for identifier matcher * Use new scope handler in relative scope stage * Use new scope handlers in ordinal scope stage * Update usage of containing indices * Rename * Refactored create target * Clean up * clean up * Add some tests that should pass * Add a bunch more tests * Attempt at different approach to scope handlers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Initial implementation of new idea * More work on this stuff * Rename and add some todos * More stuff * Tweaks * Renames and docstrings * Restructuring * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * More jsdocs * Tweaks * Test fixes * Fix error messages * Revert `OrdinalScopeStage` * Tweak * jsdocs; fix import * Don't export legacy types * Fix import * Preparation for surrounding pairs * Naming cleanup * Unify `getLegacyScopeStage` functions * Lots of cleanup * Fix regex `lastIndex` issue * More cleanup * More cleanup * More cleanup * Add `ancestorIndex` in prepartion for #124 * Add more jsdocs * More docs * More docs * docstrings * Improve hierarchical error type * Docs * More minor dog tweaks * More docs * More docs * Doc strings and a couple tests * Remove `isPreferredOver` * Support `ancestorIndex` on api surface * Improved jsdocs * Split and cleanup relative stages * Make scope handler constructor args optional * More legacy type fixes * Add `"identifier"` scope * Working new code * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Docs + cheatsheet * Update docs * Add jsdoc * jsdoc * JSDocs * doc tweaks * reflow * Tweaks Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Came across this after discovering The idea reminds me of VSCode 'Expand selection' command. |
Making expanding to a scope non-idempotent is an idea I've already had. One could argue about the behavior between commands versus inside the same command, but the idea is very similar. |
We rely on idempotence in certain scenarios. For example, for "instance", we attempt to expand to token to determine if it's a token. I'd be hesitant to change these semantics, but I can see how it could be useful |
* Original scope handlers * More stuff * Use proper token stage in sub token stage * Work around for identifier matcher * Use new scope handler in relative scope stage * Use new scope handlers in ordinal scope stage * Update usage of containing indices * Rename * Refactored create target * Clean up * clean up * Add some tests that should pass * Add a bunch more tests * Attempt at different approach to scope handlers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Initial implementation of new idea * More work on this stuff * Rename and add some todos * More stuff * Tweaks * Renames and docstrings * Restructuring * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * More jsdocs * Tweaks * Test fixes * Fix error messages * Revert `OrdinalScopeStage` * Tweak * jsdocs; fix import * Don't export legacy types * Fix import * Preparation for surrounding pairs * Naming cleanup * Unify `getLegacyScopeStage` functions * Lots of cleanup * Fix regex `lastIndex` issue * More cleanup * More cleanup * More cleanup * Add `ancestorIndex` in prepartion for cursorless-dev#124 * Add more jsdocs * More docs * More docs * docstrings * Improve hierarchical error type * Docs * More minor dog tweaks * More docs * More docs * Doc strings and a couple tests * Remove `isPreferredOver` * Support `ancestorIndex` on api surface * Improved jsdocs * Split and cleanup relative stages * Make scope handler constructor args optional * More legacy type fixes * Add `"identifier"` scope * Working new code * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Docs + cheatsheet * Update docs * Add jsdoc * jsdoc * JSDocs * doc tweaks * reflow * Tweaks Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Eg "take grand funk" would take function containing function contains token. Could also add "great grand funk" etc.
The text was updated successfully, but these errors were encountered: