-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Switch targets to object-oriented #210
Comments
This was referenced Aug 10, 2021
|
I think we prob potentially want edit constructors instead of ranges, eg for camel-case, no? |
1 similar comment
I think we prob potentially want edit constructors instead of ranges, eg for camel-case, no? |
I think we prob want |
We can do that |
This was referenced Jan 18, 2022
This was referenced Jan 23, 2022
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The problem
As we move towards fully compositional cursorless modifier pipelines (#69), each cursorless target needs to have enough information so that subsequent pipeline steps can do their job. In addition, we have found that oftentimes different actions need to repeat the the same code to operate on a given type of target. For example, the
"chuck"
,"move"
and"carve"
commands all need to know how to remove a given target. We'd like to bake more intelligence into the targets themselves.In addition, once we have #46, we want to have rich targets that can refer to more than just locations in a document. Having smart targets will enable many advanced use cases. See What's next for more.
The solution
Target will become object-oriented, with the following methods
getContentSelection
(used for selection, get text, highlight for reference)getRemovalDecorationRange
constructChangeEdit
(takes text)constructInsertionEdit
(takes text and returns edit that has range as a selection, so that paste can use empty string then set cursor to active before pasting)constructRemovalEdit
The target will also have the following, but somehow hide it before action sees it because it shouldn't be used there. It's mostly for downstream pipeline stages, eg "after":
"every <scope>"
/"<ordinal> <scope>"
#51 / Add support for “grand” scopes #124Other stuff to think about
Positional modifier is just a pipeline stage
Need to have proper "insert" command and then can distinguish between "insert after" vs "change after" (changes delimiter)
The text was updated successfully, but these errors were encountered: