Skip to content

Commit 00d596a

Browse files
Support generic scoped types for java (#1870)
Fixes #1828 ## Checklist - [x] 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
1 parent 99cf030 commit 00d596a

File tree

2 files changed

+38
-0
lines changed
  • packages
    • cursorless-engine/src/languages
    • cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/java

2 files changed

+38
-0
lines changed

packages/cursorless-engine/src/languages/java.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const nodeMatchers: Partial<
9393
type: trailingMatcher([
9494
"generic_type.type_arguments.type_identifier",
9595
"generic_type.type_identifier",
96+
"generic_type.scoped_type_identifier.type_identifier",
9697
"type_identifier",
9798
"local_variable_declaration[type]",
9899
"array_creation_expression[type]",
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
languageId: java
2+
command:
3+
version: 6
4+
spokenForm: change type
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: type}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |
15+
import java.util.Map;
16+
17+
public class MyClass {
18+
public void myFunk() {
19+
Map.Entry<String, String> e = null;
20+
}
21+
}
22+
selections:
23+
- anchor: {line: 4, character: 4}
24+
active: {line: 4, character: 4}
25+
marks: {}
26+
finalState:
27+
documentContents: |
28+
import java.util.Map;
29+
30+
public class MyClass {
31+
public void myFunk() {
32+
e = null;
33+
}
34+
}
35+
selections:
36+
- anchor: {line: 4, character: 4}
37+
active: {line: 4, character: 4}

0 commit comments

Comments
 (0)