-
-
Notifications
You must be signed in to change notification settings - Fork 84
Added support for previous and next containing scope type #960
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
Conversation
@phillco @auscompgeek I have now updated previous/next to use existing ordinal range modifier. For now I have removed all changes Talon side and is going to do a follow up pr regarding #13 where I'm going to implement all the grammar and thoroughly test these. I think we need a discussion about how to handle relative sub tokens with regards to explicit range. For now relative is not enabled for sub tokens. |
…less-vscode into previousNextContainingScope
@pokey Modifiers are renamed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I pushed a bunch of minor changes, and was hoping to just do everything myself, but ran into an issue with the logic for relative scopes, and I think it may require a rethinking of the way you handle relative scopes, so I'm going to put this one back into your court
src/processTargets/modifiers/ordinalStages/RelativeScopeStage.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I made a bunch of minor changes, and left one question. Lmk if you have a problem with any of the changes, and curious to hear your thoughts on my comment, but otherwise good to go!
src/processTargets/modifiers/ordinalStages/RelativeScopeStage.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I think this is good to go! I added a bunch of tests and did some cleanup. Have a quick look before you merge to make sure you're happy
Fwiw I made a super basic grammar for "two funk"
so I could easily add tests; doesn't have pluralisation tho so I'm not going to merge it. Here it is tho in case helpful
I think it looks good :) |
* Added support for previous and next containing scope type * Added tests * Reverse changes * Reuse ordinal range for previous/next modifier * Use correct relative index * Added word and character as proper scope types * Select correct target * Always use token range * Cleanup * Clean up * New implementation of ordinal stage * Updated tests * Started working on migration * Made all tests pass * Added comment * Clean up * Added range modifier * Added tests for scope type word and character * Clean up * Created ordinal capture * Added ordinal items tests * cleanup * Added previous/next capture * Clean up * Update cursorless-talon/src/modifiers/ordinals.py Co-authored-by: Pokey Rule <[email protected]> * Use if statement instead of attribute error * Added index file * Update src/processTargets/processTargets.ts Co-authored-by: Pokey Rule <[email protected]> * Update src/typings/targetDescriptor.types.ts Co-authored-by: Pokey Rule <[email protected]> * Update src/typings/targetDescriptor.types.ts Co-authored-by: Pokey Rule <[email protected]> * Update src/typings/targetDescriptor.types.ts Co-authored-by: Pokey Rule <[email protected]> * cleanup * Added tests * Clean up types * Clean up * Added tests * Clean up * Clean up import * Clean up * Move ordinal stages into own directory * Prefer to take scopes to the right * Added additional word tests * Made migration for line number mark * Fixed correct type * Update grapheme regex * Added additional tests * rename * Use name mark * Updated modifier names * Split ordinal and relative scope python files * `lineType` => `lineNumberType` * Tweak token grapheme splitter * Rename variable * Clarify duplicate range stage names * Tweaks to relative scope stage * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added support for non containing relative scope * More clean up to relative scope * Rename * Reduce nesting * Tweaks to sub token stage * Doc strings * More tweaks to RelativeScopeStage * Add comment * Add comments * Improve error message * Add a bunch of tests Co-authored-by: Pokey Rule <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…-dev#960) * Added support for previous and next containing scope type * Added tests * Reverse changes * Reuse ordinal range for previous/next modifier * Use correct relative index * Added word and character as proper scope types * Select correct target * Always use token range * Cleanup * Clean up * New implementation of ordinal stage * Updated tests * Started working on migration * Made all tests pass * Added comment * Clean up * Added range modifier * Added tests for scope type word and character * Clean up * Created ordinal capture * Added ordinal items tests * cleanup * Added previous/next capture * Clean up * Update cursorless-talon/src/modifiers/ordinals.py Co-authored-by: Pokey Rule <[email protected]> * Use if statement instead of attribute error * Added index file * Update src/processTargets/processTargets.ts Co-authored-by: Pokey Rule <[email protected]> * Update src/typings/targetDescriptor.types.ts Co-authored-by: Pokey Rule <[email protected]> * Update src/typings/targetDescriptor.types.ts Co-authored-by: Pokey Rule <[email protected]> * Update src/typings/targetDescriptor.types.ts Co-authored-by: Pokey Rule <[email protected]> * cleanup * Added tests * Clean up types * Clean up * Added tests * Clean up * Clean up import * Clean up * Move ordinal stages into own directory * Prefer to take scopes to the right * Added additional word tests * Made migration for line number mark * Fixed correct type * Update grapheme regex * Added additional tests * rename * Use name mark * Updated modifier names * Split ordinal and relative scope python files * `lineType` => `lineNumberType` * Tweak token grapheme splitter * Rename variable * Clarify duplicate range stage names * Tweaks to relative scope stage * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added support for non containing relative scope * More clean up to relative scope * Rename * Reduce nesting * Tweaks to sub token stage * Doc strings * More tweaks to RelativeScopeStage * Add comment * Add comments * Improve error message * Add a bunch of tests Co-authored-by: Pokey Rule <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
"take next funk"
"change previous state"
For now you can't use this when not in the current containing scope. This is a limitation of our current implication of every. I still feel it could be really useful.
Fixes #982
Checklist