summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2019-01-04 23:55:12 -0800
committerGeorge Fraser <george@fivetran.com>2019-01-04 23:55:12 -0800
commit063f665ef7b6be147602d042028e9b2a51476077 (patch)
tree3570bd8eb53f6a2470776d92d2f7bd0679899995
parent72adf137392990a02c819d23eb2ef44eeb701e02 (diff)
downloadjava-language-server-063f665ef7b6be147602d042028e9b2a51476077.zip
Cleanup
-rw-r--r--src/main/java/org/javacs/JavaCompilerService.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/javacs/JavaCompilerService.java b/src/main/java/org/javacs/JavaCompilerService.java
index b6dbc0e..1646ecb 100644
--- a/src/main/java/org/javacs/JavaCompilerService.java
+++ b/src/main/java/org/javacs/JavaCompilerService.java
@@ -426,8 +426,9 @@ public class JavaCompilerService {
// You can't reference a TypeElement without importing it
if (to instanceof TypeElement) {
- hasWord = imports(hasWord, (TypeElement) to);
+ hasWord = hasImport(hasWord, (TypeElement) to);
}
+ // TODO for non-TypeElements, check for indirect imports
// Parse each file and check if the syntax tree is consistent with a definition of `to`
// This produces some false positives, but parsing is much faster than compiling,
@@ -531,7 +532,7 @@ public class JavaCompilerService {
return hasWord;
}
- private List<Path> imports(Collection<Path> allFiles, TypeElement to) {
+ private List<Path> hasImport(Collection<Path> allFiles, TypeElement to) {
// Figure out which files import `to`, explicitly or implicitly
var toPackage = packageName(to);
var toClass = className(to);