summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2018-12-30 23:53:50 -0800
committerGeorge Fraser <george@fivetran.com>2018-12-30 23:53:50 -0800
commitc5ed7d5755568189a09472d52d2dfe88c79bf70a (patch)
tree69f846b6301aba1ddb5fa8909eb6a8bd4a7b618a /src
parentbb0a7dd680661f01a8bb626177e3c0fe3a1e8d6a (diff)
downloadjava-language-server-c5ed7d5755568189a09472d52d2dfe88c79bf70a.zip
Fixes
Diffstat (limited to 'src')
-rw-r--r--src/test/java/org/javacs/CompletionsTest.java22
-rw-r--r--src/test/test-project/workspace/src/org/javacs/example/CompleteEnumMap.java15
2 files changed, 37 insertions, 0 deletions
diff --git a/src/test/java/org/javacs/CompletionsTest.java b/src/test/java/org/javacs/CompletionsTest.java
index 37e46f4..5469dc7 100644
--- a/src/test/java/org/javacs/CompletionsTest.java
+++ b/src/test/java/org/javacs/CompletionsTest.java
@@ -62,6 +62,28 @@ public class CompletionsTest extends CompletionsBase {
}
@Test
+ public void enumMapMembers() {
+ var suggestions = insertTemplate("/org/javacs/example/CompleteEnumMap.java", 9, 13);
+ assertThat(
+ suggestions,
+ hasItems(
+ "clear",
+ "clone",
+ "containsKey",
+ "containsValue",
+ "entrySet",
+ "equals",
+ "get",
+ "hashCode",
+ "keySet",
+ "put",
+ "putAll",
+ "remove",
+ "size",
+ "values"));
+ }
+
+ @Test
public void fieldFromInitBlock() {
var file = "/org/javacs/example/AutocompleteMembers.java";
diff --git a/src/test/test-project/workspace/src/org/javacs/example/CompleteEnumMap.java b/src/test/test-project/workspace/src/org/javacs/example/CompleteEnumMap.java
new file mode 100644
index 0000000..20b159d
--- /dev/null
+++ b/src/test/test-project/workspace/src/org/javacs/example/CompleteEnumMap.java
@@ -0,0 +1,15 @@
+package org.javacs.example;
+
+import java.util.EnumMap;
+
+
+public class CompleteEnumMap {
+ void main() {
+ var map = new EnumMap<>(Foo.class);
+ map.
+ }
+
+ enum Foo {
+ Bar;
+ }
+} \ No newline at end of file