-
-
Notifications
You must be signed in to change notification settings - Fork 84
Community wrapper snippets #1998
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
…v/cursorless into community_wrapper_snippets
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.
This looks fine but what happens if they're on old version of community? Need to make sure we degrade gracefully
Also, I believe there's now a spoken form ambiguity with "funk wrap", no?
I wonder if it would be better for talon to just tell Cursorless where the snippets are using the new state.json file and let it parse them itself so it can handle disambiguating 🤔
I think it reasonable to expect people to update community before cursorless. I know of no way of using community lists or captures in cursorless that would not show an error in the log if missing. The ambiguity would be there if we added the command to community as well. You just cant define the same snippet phrase in both places. I prefer the rpc solution. |
I completely disagree. We have gone out of our way to make Cursorless talon files easy to update by supporting extensive customization. It is not uncommon for people to go months without updating community, because the fact that the only way to tweak community oftentimes is to directly change it means that upgrades can be quite painful We should discuss a way to make Cursorless backwards compatible with community. We've done it before, but I believe that was for a new action, so we could easily wrap it in a try-catch
Not saying it wouldn't, just pointing it out. Could be surprising if you change your function snippet in community and it doesn't update because Cursorless is preferring the Cursorless one |
Doesn't that mean that we can never utilize new list or captures from community? I know of no mechanism to solve that. Yes you can't have the same snippet in both. Personally I have totally disabled cursorless snippets. Getting around this problem might be interesting. |
We could add a context key that we set from community and then match on that?
Yeah would be worth discussing. Esp since we ship with a conflicting snippet 🤔
to discuss
|
Unfortunately results in the same problem. If that tag is missing from community because of an older version then cursorless would error in the log.
Agreed. |
No not a tag a context key. Do those have to be declared? |
Not sure I follow. Do you mean like Probably same problem |
Not sure. You don't explicitly declare the key for a scope in the same way as you declare a tag, so it seems possible that it won't throw an exception if undefined. If that doesn't work, we could possibly make an onready in cursorless talon that tries to call some action (wrapped in a try-catch) to see whether it exists, and if it does, sets a tag Anyways we can discuss if none of these options make sense to you; there's usually a way to make things work, with enough elbow grease 🙂 |
update from meet-up:
|
I wonder if it's worth considering sharing the snippets from Talon to Cursorless via |
@pokey updated |
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.
left a couple comments
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.
made minor fix; otherwise looks good! See comments / fix in talonhub/community#1315 as well
Thanks. Community updated with your suggestion |
…ippets' of github.com:cursorless-dev/cursorless into community_wrapper_snippets
Ok looking good. Is there a way to test this? Ie could we activate the use_community tag for part of our tests? |
Probably doable? |
update from meet-up:
|
There is a spoken form inconsistency here: in community, the spoken form for snippet insertion is "snip", but the default spoken form for snippet insertion in Cursorless is "snippet". So out of the box, it will be "snip funk", but "snippet funk after air". Not entirely sure how to handle that 🤔 |
Ok I added tests, but:
|
update from meet-up:
|
Is this not merging because of the failing test? |
Yeah it got caught in that weird windows CI issue; totally unrelated to this PR. Just updated the branch so it gets the fix. Should pass and merge shortly |
This is the Cursorless side of the community wrapper snippets talonhub/community#1315 ## Checklist - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Pokey Rule <[email protected]>
This is the Cursorless side of the community wrapper snippets
talonhub/community#1315
Checklist