-
-
Notifications
You must be signed in to change notification settings - Fork 84
Support specializing snippet definitions by containing scope #1487
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
Merged
AndreasArvidsson
merged 4 commits into
main
from
pokey/support-specializing-snippet-definitions-by-containing-scope
May 24, 2023
Merged
Support specializing snippet definitions by containing scope #1487
AndreasArvidsson
merged 4 commits into
main
from
pokey/support-specializing-snippet-definitions-by-containing-scope
May 24, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3e8bf83
to
f7b1958
Compare
pokey
commented
May 19, 2023
pokey
commented
May 19, 2023
pokey
commented
May 19, 2023
// We don't want snippets from all files to stop working if there is | ||
// a parse error in one file, so we just effectively ignore this file | ||
// once we've shown an error message | ||
this.userSnippets = await Promise.all( |
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.
don't merge here; we handle things more carefully now, when we do the final merge below
pokey
commented
May 19, 2023
pokey
commented
May 19, 2023
pokey
commented
May 19, 2023
42828ac
to
46114e1
Compare
pokey
commented
May 19, 2023
packages/cursorless-engine/src/processTargets/targets/BaseTarget.ts
Outdated
Show resolved
Hide resolved
e4759c3
to
760ca9b
Compare
760ca9b
to
a0ad4f6
Compare
55bbf67
to
e8a7509
Compare
pokey
commented
May 23, 2023
{ | ||
body: [""], | ||
scope: { | ||
scopeTypes: ["anonymousFunction"], |
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.
change precedence:
- have language at all wins out over having scope type but no language
- but having scope type with two languages wins out over having no scope type with one language
AndreasArvidsson
approved these changes
May 24, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I thought this one would be a quick win, but deciding which matching snippet should apply turned out to be complex
Note that we don't support scope specialisation for custom snippets; should be a fairly easy follow-up PR building on this machinery.
Checklist