diff options
author | George Fraser <george@fivetran.com> | 2017-07-15 23:30:05 -0700 |
---|---|---|
committer | George Fraser <george@fivetran.com> | 2017-07-15 23:30:05 -0700 |
commit | 2ec98a5bc8078fcec50493edcf705206f3c2b70f (patch) | |
tree | b676a565fd6fd123a5a7eac55bcf2729dac564c7 /src/test | |
parent | aedfb21209c813333610fcd8a1785b5699dce943 (diff) | |
download | java-language-server-2ec98a5bc8078fcec50493edcf705206f3c2b70f.zip |
Everything except source-path constructors works
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/javacs/CompletionsTest.java | 17 | ||||
-rw-r--r-- | src/test/test-project/workspace/src/org/javacs/example/AutocompleteOtherPackage.java | 7 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/test/java/org/javacs/CompletionsTest.java b/src/test/java/org/javacs/CompletionsTest.java index 5a81862..55be8ae 100644 --- a/src/test/java/org/javacs/CompletionsTest.java +++ b/src/test/java/org/javacs/CompletionsTest.java @@ -555,6 +555,23 @@ public class CompletionsTest extends CompletionsBase { } @Test + public void otherPackageId() throws IOException { + String file = "/org/javacs/example/AutocompleteOtherPackage.java"; + + // Static methods + List<? extends CompletionItem> items = items(file, 5, 14); + List<String> suggestions = Lists.transform(items, i -> i.getLabel()); + + assertThat(suggestions, hasItems("OtherPackagePublic")); + assertThat(suggestions, not(hasItems("OtherPackagePrivate"))); + + for (CompletionItem item : items) { + if (item.getLabel().equals("OtherPackagePublic")) + assertThat("Auto-import OtherPackagePublic", item.getAdditionalTextEdits(), not(empty())); + } + } + + @Test public void fieldFromStaticInner() throws IOException { String file = "/org/javacs/example/AutocompleteOuter.java"; diff --git a/src/test/test-project/workspace/src/org/javacs/example/AutocompleteOtherPackage.java b/src/test/test-project/workspace/src/org/javacs/example/AutocompleteOtherPackage.java new file mode 100644 index 0000000..796b1b7 --- /dev/null +++ b/src/test/test-project/workspace/src/org/javacs/example/AutocompleteOtherPackage.java @@ -0,0 +1,7 @@ +package org.javacs.example; + +public class AutocompleteOtherPackage { + public void test() { + Other + } +}
\ No newline at end of file |