mirror of
https://github.com/cursorless-dev/cursorless.git
synced 2024-10-05 05:17:38 +03:00
Added fields and methods to java statement definition (#1117)
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
This commit is contained in:
parent
ac2a5411d9
commit
ccf9d68166
@ -47,6 +47,9 @@ const STATEMENT_TYPES = [
|
||||
// ";",
|
||||
// "block",
|
||||
"switch_statement",
|
||||
"method_declaration",
|
||||
"constructor_declaration",
|
||||
"field_declaration",
|
||||
];
|
||||
|
||||
const nodeMatchers: Partial<
|
||||
|
@ -0,0 +1,30 @@
|
||||
languageId: java
|
||||
command:
|
||||
spokenForm: clear state
|
||||
version: 3
|
||||
targets:
|
||||
- type: primitive
|
||||
modifiers:
|
||||
- type: containingScope
|
||||
scopeType: {type: statement}
|
||||
usePrePhraseSnapshot: true
|
||||
action: {name: clearAndSetSelection}
|
||||
initialState:
|
||||
documentContents: |
|
||||
public class MyClass {
|
||||
@Inject
|
||||
private Aaa aaa;
|
||||
}
|
||||
selections:
|
||||
- anchor: {line: 2, character: 4}
|
||||
active: {line: 2, character: 4}
|
||||
marks: {}
|
||||
finalState:
|
||||
documentContents: |
|
||||
public class MyClass {
|
||||
|
||||
}
|
||||
selections:
|
||||
- anchor: {line: 1, character: 4}
|
||||
active: {line: 1, character: 4}
|
||||
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: containingScope, scopeType: {type: statement}}]}]
|
@ -0,0 +1,29 @@
|
||||
languageId: java
|
||||
command:
|
||||
spokenForm: clear state
|
||||
version: 3
|
||||
targets:
|
||||
- type: primitive
|
||||
modifiers:
|
||||
- type: containingScope
|
||||
scopeType: {type: statement}
|
||||
usePrePhraseSnapshot: true
|
||||
action: {name: clearAndSetSelection}
|
||||
initialState:
|
||||
documentContents: |
|
||||
public class MyClass {
|
||||
private String value = "hello";
|
||||
}
|
||||
selections:
|
||||
- anchor: {line: 1, character: 4}
|
||||
active: {line: 1, character: 4}
|
||||
marks: {}
|
||||
finalState:
|
||||
documentContents: |
|
||||
public class MyClass {
|
||||
|
||||
}
|
||||
selections:
|
||||
- anchor: {line: 1, character: 4}
|
||||
active: {line: 1, character: 4}
|
||||
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: containingScope, scopeType: {type: statement}}]}]
|
@ -0,0 +1,30 @@
|
||||
languageId: java
|
||||
command:
|
||||
spokenForm: clear state
|
||||
version: 3
|
||||
targets:
|
||||
- type: primitive
|
||||
modifiers:
|
||||
- type: containingScope
|
||||
scopeType: {type: statement}
|
||||
usePrePhraseSnapshot: true
|
||||
action: {name: clearAndSetSelection}
|
||||
initialState:
|
||||
documentContents: |
|
||||
public class MyClass {
|
||||
public MyClass() {
|
||||
}
|
||||
}
|
||||
selections:
|
||||
- anchor: {line: 1, character: 4}
|
||||
active: {line: 1, character: 4}
|
||||
marks: {}
|
||||
finalState:
|
||||
documentContents: |
|
||||
public class MyClass {
|
||||
|
||||
}
|
||||
selections:
|
||||
- anchor: {line: 1, character: 4}
|
||||
active: {line: 1, character: 4}
|
||||
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: containingScope, scopeType: {type: statement}}]}]
|
@ -0,0 +1,30 @@
|
||||
languageId: java
|
||||
command:
|
||||
spokenForm: clear state
|
||||
version: 3
|
||||
targets:
|
||||
- type: primitive
|
||||
modifiers:
|
||||
- type: containingScope
|
||||
scopeType: {type: statement}
|
||||
usePrePhraseSnapshot: true
|
||||
action: {name: clearAndSetSelection}
|
||||
initialState:
|
||||
documentContents: |
|
||||
public class MyClass {
|
||||
private void myFunction() {
|
||||
}
|
||||
}
|
||||
selections:
|
||||
- anchor: {line: 1, character: 4}
|
||||
active: {line: 1, character: 4}
|
||||
marks: {}
|
||||
finalState:
|
||||
documentContents: |
|
||||
public class MyClass {
|
||||
|
||||
}
|
||||
selections:
|
||||
- anchor: {line: 1, character: 4}
|
||||
active: {line: 1, character: 4}
|
||||
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: containingScope, scopeType: {type: statement}}]}]
|
@ -0,0 +1,26 @@
|
||||
languageId: java
|
||||
command:
|
||||
spokenForm: clear state
|
||||
version: 3
|
||||
targets:
|
||||
- type: primitive
|
||||
modifiers:
|
||||
- type: containingScope
|
||||
scopeType: {type: statement}
|
||||
usePrePhraseSnapshot: true
|
||||
action: {name: clearAndSetSelection}
|
||||
initialState:
|
||||
documentContents: |
|
||||
public class MyClass {
|
||||
}
|
||||
selections:
|
||||
- anchor: {line: 0, character: 0}
|
||||
active: {line: 0, character: 0}
|
||||
marks: {}
|
||||
finalState:
|
||||
documentContents: |+
|
||||
|
||||
selections:
|
||||
- anchor: {line: 0, character: 0}
|
||||
active: {line: 0, character: 0}
|
||||
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: containingScope, scopeType: {type: statement}}]}]
|
Loading…
Reference in New Issue
Block a user