Skip to content
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

Merged
merged 6 commits into from
Aug 22, 2023

Conversation

pokey
Copy link
Member

@pokey pokey commented May 5, 2023

This PR allows us to say things like "take state" when we're working on .scm files.

Checklist

  • I have added tests
  • Add trailing delimiter to "key"
  • File issue for "bring to name" when there are multiple names
  • I have updated the docs and cheatsheet
  • I have not broken the cheatsheet

@pokey pokey force-pushed the base/pokey/initial-tree-sitter-support-for-scm-files branch from d71e8ca to 96f26c3 Compare May 5, 2023 15:04
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch 3 times, most recently from 3486f5d to f0de95f Compare May 5, 2023 16:11
@pokey pokey changed the base branch from base/pokey/initial-tree-sitter-support-for-scm-files to pokey/support-adding-languages-using-only-queries May 6, 2023 15:45
queries/scm.scm Show resolved Hide resolved
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch from f0de95f to d232c0c Compare May 11, 2023 14:06
@pokey pokey force-pushed the pokey/support-adding-languages-using-only-queries branch 2 times, most recently from 57f0efd to 8ae3a2c Compare May 11, 2023 15:40
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch from d232c0c to 38c9523 Compare May 11, 2023 15:40
Base automatically changed from pokey/support-adding-languages-using-only-queries to main May 11, 2023 16:24
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch from 38c9523 to e250f98 Compare May 12, 2023 13:25
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch 3 times, most recently from 29cfe67 to f9970af Compare June 8, 2023 13:24
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch 2 times, most recently from 430f938 to db358bb Compare June 8, 2023 13:32
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch 4 times, most recently from 0701a0c to 94f718c Compare June 8, 2023 14:26
@pokey pokey changed the title Initial tree-sitter support for .scm files Add Cursorless support for tree-sitter query .scm files Jun 13, 2023
@pokey pokey added the to discuss Plan to discuss at meet-up label Jun 13, 2023
queries/scm.scm Outdated Show resolved Hide resolved
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch 3 times, most recently from 03f50b8 to 95f982c Compare August 17, 2023 00:31
github-merge-queue bot pushed a commit that referenced this pull request Aug 17, 2023
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch from 95f982c to dbf05d1 Compare August 21, 2023 13:48
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch 3 times, most recently from 9f345ee to 4c7d503 Compare August 21, 2023 20:04
@pokey pokey force-pushed the pokey/initial-tree-sitter-support-for-scm-files branch from 4c7d503 to b78c097 Compare August 21, 2023 20:09
@@ -130,7 +130,7 @@ const testCases: TestCase[] = [
},

{
name: "should show error for capture with multiple start",
name: "should allow capture with multiple start",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: (aaa) @
Copy link
Member Author

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) "
Copy link
Member Author

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 "
Copy link
Member Author

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)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests #1763

Comment on lines +60 to +61
;;! *********
;;! --------------- <~ iteration domain
Copy link
Member Author

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

@pokey pokey marked this pull request as ready for review August 21, 2023 20:10
@josharian
Copy link
Collaborator

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",
Copy link
Member

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.

Copy link
Member Author

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

@pokey pokey enabled auto-merge August 22, 2023 12:33
@pokey pokey added this pull request to the merge queue Aug 22, 2023
Merged via the queue into main with commit 2bc7a94 Aug 22, 2023
14 checks passed
@pokey pokey deleted the pokey/initial-tree-sitter-support-for-scm-files branch August 22, 2023 13:00
@josharian
Copy link
Collaborator

…and with this in, a bunch of the Go query issues I was struggling with have been resolved. Yay, thanks for paving this road!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants