summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2019-01-08 20:50:25 -0800
committerGeorge Fraser <george@fivetran.com>2019-01-08 20:50:25 -0800
commit04e4f359cb80c7b8e450103dc7331f6deb363872 (patch)
treeb164426b6d85ba9bdcca10205eb395105efb2c47 /src/test
parent938fce4f8d2630d456caea03b0c178508680e945 (diff)
downloadjava-language-server-04e4f359cb80c7b8e450103dc7331f6deb363872.zip
Fixes
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/javacs/GotoTest.java7
-rw-r--r--src/test/test-project/workspace/src/org/javacs/example/Goto.java4
-rw-r--r--src/test/test-project/workspace/src/org/javacs/example/GotoPackagePrivate.java5
3 files changed, 16 insertions, 0 deletions
diff --git a/src/test/java/org/javacs/GotoTest.java b/src/test/java/org/javacs/GotoTest.java
index 6587eca..5eb0a52 100644
--- a/src/test/java/org/javacs/GotoTest.java
+++ b/src/test/java/org/javacs/GotoTest.java
@@ -168,6 +168,13 @@ public class GotoTest {
assertThat(doGoto(file, 5, 22), empty());
}
+ @Test
+ public void packagePrivate() {
+ var suggestions = doGoto(file, 50, 42);
+
+ assertThat(suggestions, hasItem("GotoPackagePrivate.java:4"));
+ }
+
private static final JavaLanguageServer server = LanguageServerFixture.getJavaLanguageServer();
private List<String> doGoto(String file, int row, int column) {
diff --git a/src/test/test-project/workspace/src/org/javacs/example/Goto.java b/src/test/test-project/workspace/src/org/javacs/example/Goto.java
index 3f4cb2f..6d1b698 100644
--- a/src/test/test-project/workspace/src/org/javacs/example/Goto.java
+++ b/src/test/test-project/workspace/src/org/javacs/example/Goto.java
@@ -45,4 +45,8 @@ public class Goto<Param> {
}
public Param getParam() {
}
+
+ void testGotoPackagePrivate() {
+ var x = GotoPackagePrivate.PUBLIC_FIELD;
+ }
} \ No newline at end of file
diff --git a/src/test/test-project/workspace/src/org/javacs/example/GotoPackagePrivate.java b/src/test/test-project/workspace/src/org/javacs/example/GotoPackagePrivate.java
new file mode 100644
index 0000000..0c5ba11
--- /dev/null
+++ b/src/test/test-project/workspace/src/org/javacs/example/GotoPackagePrivate.java
@@ -0,0 +1,5 @@
+package org.javacs.example;
+
+class GotoPackagePrivate {
+ public static int PUBLIC_FIELD = 1;
+} \ No newline at end of file