summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2018-09-21 16:34:57 -0700
committerGeorge Fraser <george@fivetran.com>2018-09-21 16:34:57 -0700
commit6505957d90a5109e51cb9b2f26f1bc00c1222421 (patch)
tree1a02c57a16ba238a2b12cb1170a43e129091e4a4 /src/test
parentbcefd1fa66b2a0063245702dfe1f731015810a5c (diff)
downloadjava-language-server-6505957d90a5109e51cb9b2f26f1bc00c1222421.zip
Complete .length
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/javacs/CompletionsTest.java10
-rw-r--r--src/test/test-project/workspace/src/org/javacs/example/AutocompleteArray.java9
2 files changed, 19 insertions, 0 deletions
diff --git a/src/test/java/org/javacs/CompletionsTest.java b/src/test/java/org/javacs/CompletionsTest.java
index c56cf0e..3a4bb54 100644
--- a/src/test/java/org/javacs/CompletionsTest.java
+++ b/src/test/java/org/javacs/CompletionsTest.java
@@ -284,6 +284,16 @@ public class CompletionsTest extends CompletionsBase {
assertThat(suggestions, hasItems("AutocompleteOther", "AutocompleteMember"));
}
+ @Test
+ public void arrayLength() throws IOException {
+ var file = "/org/javacs/example/AutocompleteArray.java";
+
+ // a.?
+ var suggestions = insertText(file, 7, 11);
+
+ assertThat(suggestions, hasItems("length"));
+ }
+
@Ignore // We are now managing imports with FixImports
@Test
public void addImport() {
diff --git a/src/test/test-project/workspace/src/org/javacs/example/AutocompleteArray.java b/src/test/test-project/workspace/src/org/javacs/example/AutocompleteArray.java
new file mode 100644
index 0000000..05ff9dc
--- /dev/null
+++ b/src/test/test-project/workspace/src/org/javacs/example/AutocompleteArray.java
@@ -0,0 +1,9 @@
+package org.javacs.example;
+
+class AutocompleteArray {
+ void test() {
+ var a = new int[]{1, 2};
+
+ a.
+ }
+} \ No newline at end of file