-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add Cursorless support for tree-sitter query .scm
files
#1448
Conversation
d71e8ca
to
96f26c3
Compare
3486f5d
to
f0de95f
Compare
f0de95f
to
d232c0c
Compare
57f0efd
to
8ae3a2c
Compare
d232c0c
to
38c9523
Compare
38c9523
to
e250f98
Compare
29cfe67
to
f9970af
Compare
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/clearEveryName.yml
Outdated
Show resolved
Hide resolved
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/clearValue.yml
Outdated
Show resolved
Hide resolved
430f938
to
db358bb
Compare
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/clearCallee.yml
Outdated
Show resolved
Hide resolved
0701a0c
to
94f718c
Compare
.scm
files
03f50b8
to
95f982c
Compare
- Fixes #1609 - Required by / tested by #1448 ## 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
95f982c
to
dbf05d1
Compare
9f345ee
to
4c7d503
Compare
4c7d503
to
b78c097
Compare
@@ -130,7 +130,7 @@ const testCases: TestCase[] = [ | |||
}, | |||
|
|||
{ | |||
name: "should show error for capture with multiple start", | |||
name: "should allow capture with multiple start", |
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 turned out to be useful for this PR; see https://github.com/cursorless-dev/cursorless/pull/1448/files#diff-83dc43cab688debd9b40743b835d49f7a047d393df9da5bb39e354f39aa09966R86-R87
packages/cursorless-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts
Outdated
Show resolved
Hide resolved
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: (aaa) @ |
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.
notice how "change name"
targets all of them as one range. See #1631 (comment)
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: "(aaa) " |
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.
I don't love this space, but I think it should probably be handled by #855
active: {line: 0, character: 20} | ||
marks: {} | ||
finalState: | ||
documentContents: "(aaa) @bbb @ccc " |
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.
as above re space
scopeType: {type: collectionItem} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: ;; (aaa) |
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 tests #1763
;;! ********* | ||
;;! --------------- <~ iteration domain |
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.
Given iteration scope is just a scope, I'd be tempted to just use the regular symbols. I figure this is fine for now because these comments are only semi-formal
pumpkin now, will look tomorrow |
@@ -4,4 +4,5 @@ export const extensionDependencies = [ | |||
"scalameta.metals", | |||
"ms-python.python", | |||
"mrob95.vscode-talonscript", | |||
"jrieken.vscode-tree-sitter-query", |
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.
I'm leaning or more towards just including our own missing file extensions instead of having to add additional extension dependencies.
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.
Agreed. Tho wrt .scm specifically, @auscompgeek makes a good point that we may want to avoid that one as it is more commonly used for Scheme. But for .talon and the others I think it makes sense for us to just register them
…and with this in, a bunch of the Go query issues I was struggling with have been resolved. Yay, thanks for paving this road! |
This PR allows us to say things like
"take state"
when we're working on.scm
files."item"
fallback for next-gen scope handlers #1763Checklist