-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Include generic in java type definition #372
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bf89bd1
Include generic in java type definition
AndreasArvidsson e824567
Make typescript type scope type consistent with java
AndreasArvidsson 2e757e4
Add tests for typescript
pokey f4cea62
Upgrade tests
pokey 3b6998f
Added dock string
AndreasArvidsson feb935d
Merge branch 'java_generic' of github.com:pokey/cursorless-vscode int…
AndreasArvidsson 9ffb798
Updated type for typescript constructor arguments
AndreasArvidsson a9d6643
Include constructor identifier without argument list in the definitio…
AndreasArvidsson b449305
Add a test
pokey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/test/suite/fixtures/recorded/languages/java/takeTypeBlueLook.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
languageId: java | ||
command: | ||
version: 1 | ||
spokenForm: take type blue look | ||
action: setSelection | ||
targets: | ||
- type: primitive | ||
modifier: {type: containingScope, scopeType: type, includeSiblings: false} | ||
mark: {type: decoratedSymbol, symbolColor: blue, character: l} | ||
initialState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 38} | ||
active: {line: 2, character: 61} | ||
marks: | ||
blue.l: | ||
start: {line: 3, character: 8} | ||
end: {line: 3, character: 12} | ||
finalState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 3, character: 8} | ||
active: {line: 3, character: 20} | ||
thatMark: | ||
- anchor: {line: 3, character: 8} | ||
active: {line: 3, character: 20} | ||
fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: blue, character: l}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: type, includeSiblings: false}}] |
39 changes: 39 additions & 0 deletions
39
src/test/suite/fixtures/recorded/languages/java/takeTypeGust.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
languageId: java | ||
command: | ||
version: 1 | ||
spokenForm: take type gust | ||
action: setSelection | ||
targets: | ||
- type: primitive | ||
modifier: {type: containingScope, scopeType: type, includeSiblings: false} | ||
mark: {type: decoratedSymbol, symbolColor: default, character: g} | ||
initialState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 3, character: 8} | ||
active: {line: 3, character: 20} | ||
marks: | ||
default.g: | ||
start: {line: 3, character: 13} | ||
end: {line: 3, character: 19} | ||
finalState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 3, character: 8} | ||
active: {line: 3, character: 20} | ||
thatMark: | ||
- anchor: {line: 3, character: 8} | ||
active: {line: 3, character: 20} | ||
fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: g}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: type, includeSiblings: false}}] |
39 changes: 39 additions & 0 deletions
39
src/test/suite/fixtures/recorded/languages/java/takeTypeGust2.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
languageId: java | ||
command: | ||
version: 1 | ||
spokenForm: take type gust | ||
action: setSelection | ||
targets: | ||
- type: primitive | ||
modifier: {type: containingScope, scopeType: type, includeSiblings: false} | ||
mark: {type: decoratedSymbol, symbolColor: default, character: g} | ||
initialState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 3, character: 32} | ||
active: {line: 3, character: 49} | ||
marks: | ||
default.g: | ||
start: {line: 3, character: 42} | ||
end: {line: 3, character: 48} | ||
finalState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
AndreasArvidsson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
selections: | ||
- anchor: {line: 3, character: 32} | ||
active: {line: 3, character: 49} | ||
thatMark: | ||
- anchor: {line: 3, character: 32} | ||
active: {line: 3, character: 49} | ||
fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: g}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: type, includeSiblings: false}}] |
39 changes: 39 additions & 0 deletions
39
src/test/suite/fixtures/recorded/languages/java/takeTypeHarp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
languageId: java | ||
command: | ||
version: 1 | ||
spokenForm: take type harp | ||
action: setSelection | ||
targets: | ||
- type: primitive | ||
modifier: {type: containingScope, scopeType: type, includeSiblings: false} | ||
mark: {type: decoratedSymbol, symbolColor: default, character: h} | ||
initialState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 27} | ||
marks: | ||
default.h: | ||
start: {line: 2, character: 38} | ||
end: {line: 2, character: 45} | ||
finalState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 38} | ||
active: {line: 2, character: 61} | ||
thatMark: | ||
- anchor: {line: 2, character: 38} | ||
active: {line: 2, character: 61} | ||
fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: type, includeSiblings: false}}] |
39 changes: 39 additions & 0 deletions
39
src/test/suite/fixtures/recorded/languages/java/takeTypeLook.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
languageId: java | ||
command: | ||
version: 1 | ||
spokenForm: take type look | ||
action: setSelection | ||
targets: | ||
- type: primitive | ||
modifier: {type: containingScope, scopeType: type, includeSiblings: false} | ||
mark: {type: decoratedSymbol, symbolColor: default, character: l} | ||
initialState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 27} | ||
active: {line: 2, character: 27} | ||
marks: | ||
default.l: | ||
start: {line: 3, character: 21} | ||
end: {line: 3, character: 25} | ||
finalState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 3, character: 8} | ||
active: {line: 3, character: 20} | ||
thatMark: | ||
- anchor: {line: 3, character: 8} | ||
active: {line: 3, character: 20} | ||
fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: l}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: type, includeSiblings: false}}] |
39 changes: 39 additions & 0 deletions
39
src/test/suite/fixtures/recorded/languages/java/takeTypePit.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
languageId: java | ||
command: | ||
version: 1 | ||
spokenForm: take type pit | ||
action: setSelection | ||
targets: | ||
- type: primitive | ||
modifier: {type: containingScope, scopeType: type, includeSiblings: false} | ||
mark: {type: decoratedSymbol, symbolColor: default, character: p} | ||
initialState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 3, character: 52} | ||
active: {line: 3, character: 52} | ||
marks: | ||
default.p: | ||
start: {line: 2, character: 8} | ||
end: {line: 2, character: 11} | ||
finalState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 27} | ||
thatMark: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 27} | ||
fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: p}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: type, includeSiblings: false}}] |
39 changes: 39 additions & 0 deletions
39
src/test/suite/fixtures/recorded/languages/java/takeTypeSoon.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
languageId: java | ||
command: | ||
version: 1 | ||
spokenForm: take type soon | ||
action: setSelection | ||
targets: | ||
- type: primitive | ||
modifier: {type: containingScope, scopeType: type, includeSiblings: false} | ||
mark: {type: decoratedSymbol, symbolColor: default, character: s} | ||
initialState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 27} | ||
marks: | ||
default.s: | ||
start: {line: 2, character: 12} | ||
end: {line: 2, character: 18} | ||
finalState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 27} | ||
thatMark: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 27} | ||
fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: s}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: type, includeSiblings: false}}] |
39 changes: 39 additions & 0 deletions
39
src/test/suite/fixtures/recorded/languages/java/takeTypeSoon2.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
languageId: java | ||
command: | ||
version: 1 | ||
spokenForm: take type soon | ||
action: setSelection | ||
targets: | ||
- type: primitive | ||
modifier: {type: containingScope, scopeType: type, includeSiblings: false} | ||
mark: {type: decoratedSymbol, symbolColor: default, character: s} | ||
initialState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 38} | ||
active: {line: 2, character: 61} | ||
marks: | ||
default.s: | ||
start: {line: 2, character: 54} | ||
end: {line: 2, character: 60} | ||
finalState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 38} | ||
active: {line: 2, character: 61} | ||
thatMark: | ||
- anchor: {line: 2, character: 38} | ||
active: {line: 2, character: 61} | ||
fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: s}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: type, includeSiblings: false}}] |
39 changes: 39 additions & 0 deletions
39
src/test/suite/fixtures/recorded/languages/java/takeTypeTrap.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
languageId: java | ||
command: | ||
version: 1 | ||
spokenForm: take type trap | ||
action: setSelection | ||
targets: | ||
- type: primitive | ||
modifier: {type: containingScope, scopeType: type, includeSiblings: false} | ||
mark: {type: decoratedSymbol, symbolColor: default, character: t} | ||
initialState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 27} | ||
marks: | ||
default.t: | ||
start: {line: 2, character: 20} | ||
end: {line: 2, character: 26} | ||
finalState: | ||
documentContents: |- | ||
public class MyClass { | ||
private MyClass () { | ||
Map<String, String> map = new HashMap<String, String>(); | ||
List<String> list = new ArrayList<String>(); | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 27} | ||
thatMark: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 27} | ||
fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: t}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: type, includeSiblings: false}}] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not worth rewriting all these tests, but I thought we had aligned on "clear" instead of "take" to make these tests easier to read. Makes it a bit painful having to manually count offsets to figure out what the test is doing
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.
You're completely correct.
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.
Fwiw I'm planning a rework of the tests to make modifier tests clearer / more compact, and then the "clear" / "take" thing won't matter. Not sure if I've already filed an issue but I will at some point
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.
that sounds really useful