Skip to content

Commit

Permalink
Update Java patterns for new tree-sitter grammar (cursorless-dev#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
pokey authored Jul 15, 2022
1 parent 83519e1 commit 2cf0fac
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/languages/java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const nodeMatchers: Partial<
className: "class_declaration[name]",
ifStatement: "if_statement",
string: "string_literal",
comment: "comment",
comment: ["line_comment", "block_comment", "comment"],
anonymousFunction: "lambda_expression",
list: "array_initializer",
functionCall: [
Expand Down
26 changes: 26 additions & 0 deletions src/test/suite/fixtures/recorded/languages/java/clearComment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
languageId: java
command:
spokenForm: clear comment
version: 2
targets:
- type: primitive
modifiers:
- type: containingScope
scopeType: {type: comment}
usePrePhraseSnapshot: true
action: {name: clearAndSetSelection}
initialState:
documentContents: /* Hello world */
selections:
- anchor: {line: 0, character: 9}
active: {line: 0, character: 9}
marks: {}
finalState:
documentContents: ""
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
thatMark:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: containingScope, scopeType: {type: comment}}]}]

0 comments on commit 2cf0fac

Please sign in to comment.