summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2018-09-21 23:08:44 -0700
committerGeorge Fraser <george@fivetran.com>2018-09-21 23:08:44 -0700
commitee7173d9a09c469cde92053446363aea6ec5dbf9 (patch)
treebd962e07436bfca721fb852ec8fecb34fb5b160e /src/test
parent358f73350d7331b386c78aef168091bdb8a0fc80 (diff)
downloadjava-language-server-ee7173d9a09c469cde92053446363aea6ec5dbf9.zip
Overrides
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/javacs/CompletionsTest.java8
-rw-r--r--src/test/test-project/workspace/src/org/javacs/example/AutocompleteOverride.java10
2 files changed, 18 insertions, 0 deletions
diff --git a/src/test/java/org/javacs/CompletionsTest.java b/src/test/java/org/javacs/CompletionsTest.java
index 52b1921..c8f01ca 100644
--- a/src/test/java/org/javacs/CompletionsTest.java
+++ b/src/test/java/org/javacs/CompletionsTest.java
@@ -776,4 +776,12 @@ public class CompletionsTest extends CompletionsBase {
assertThat(suggestions, hasItem(startsWith("Override")));
}
+
+ @Test
+ public void overrideMethod() {
+ var file = "/org/javacs/example/AutocompleteOverride.java";
+ var suggestions = insertText(file, 8, 15);
+
+ assertThat(suggestions, hasItem(containsString("void superMethod() {")));
+ }
}
diff --git a/src/test/test-project/workspace/src/org/javacs/example/AutocompleteOverride.java b/src/test/test-project/workspace/src/org/javacs/example/AutocompleteOverride.java
new file mode 100644
index 0000000..8211b18
--- /dev/null
+++ b/src/test/test-project/workspace/src/org/javacs/example/AutocompleteOverride.java
@@ -0,0 +1,10 @@
+package org.javacs.example;
+
+class AutocompleteOverride {
+ class Super {
+ void superMethod() {}
+ }
+ class Sub extends Super {
+ @Overr
+ }
+} \ No newline at end of file