summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2019-01-01 23:04:23 -0800
committerGeorge Fraser <george@fivetran.com>2019-01-01 23:04:23 -0800
commit09fe6882214bb530370c908edb9320b074bd0c05 (patch)
tree8f05d669b27d6466cb769004a5848f7e575ba5ee /src/test
parent818574c351f3b7ae50e36ee5fa7dadeff7393429 (diff)
downloadjava-language-server-09fe6882214bb530370c908edb9320b074bd0c05.zip
Fix code lens placement
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/javacs/CodeLensTest.java8
-rw-r--r--src/test/test-project/workspace/src/org/javacs/example/CodeLensPlacement.java9
2 files changed, 17 insertions, 0 deletions
diff --git a/src/test/java/org/javacs/CodeLensTest.java b/src/test/java/org/javacs/CodeLensTest.java
index 893c605..963929c 100644
--- a/src/test/java/org/javacs/CodeLensTest.java
+++ b/src/test/java/org/javacs/CodeLensTest.java
@@ -86,4 +86,12 @@ public class CodeLensTest {
var bad = List.of(new Ptr("org.javacs.example/ConstructorRefs#<init>(int,int)"));
assertFalse(signatureMatches.test(bad));
}
+
+ @Test
+ public void placement() {
+ var lenses = lenses("/org/javacs/example/CodeLensPlacement.java");
+ var titles = titles(lenses);
+ assertThat(titles, hasItem("4:0 references"));
+ assertThat(titles, hasItem("6:0 references"));
+ }
}
diff --git a/src/test/test-project/workspace/src/org/javacs/example/CodeLensPlacement.java b/src/test/test-project/workspace/src/org/javacs/example/CodeLensPlacement.java
new file mode 100644
index 0000000..d58bd67
--- /dev/null
+++ b/src/test/test-project/workspace/src/org/javacs/example/CodeLensPlacement.java
@@ -0,0 +1,9 @@
+package org.javacs.example;
+
+@Deprecated(since = "The presence of the word CodeLensPlacement screws up positioning")
+public class CodeLensPlacement {
+ @Deprecated(since = "The presence of the word main screws up positioning")
+ void main() {
+
+ }
+} \ No newline at end of file