Skip to content

Commit 18e79d8

Browse files
committed
Indexer should index all non-private symbols.
1 parent 07d62a7 commit 18e79d8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/main/java/org/javacomp/options/IndexOptions.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
public abstract class IndexOptions {
88
/** Indexes everything possible. */
99
public static final IndexOptions.Builder FULL_INDEX_BUILDER =
10-
IndexOptions.builder().setShouldIndexMethodContent(true).setShouldIndexNonPublic(true);
10+
IndexOptions.builder().setShouldIndexMethodContent(true).setShouldIndexPrivate(true);
1111
/** Indexes only public classes/methods/etc... without indexing the contents. */
12-
public static final IndexOptions.Builder PUBLIC_READONLY_BUILDER =
13-
IndexOptions.builder().setShouldIndexNonPublic(false).setShouldIndexMethodContent(false);
12+
public static final IndexOptions.Builder NON_PRIVATE_BUILDER =
13+
IndexOptions.builder().setShouldIndexPrivate(false).setShouldIndexMethodContent(false);
1414

15-
public abstract boolean shouldIndexNonPublic();
15+
public abstract boolean shouldIndexPrivate();
1616

1717
public abstract boolean shouldIndexMethodContent();
1818

@@ -24,7 +24,7 @@ public static Builder builder() {
2424
public abstract static class Builder {
2525
public abstract IndexOptions build();
2626

27-
public abstract Builder setShouldIndexNonPublic(boolean value);
27+
public abstract Builder setShouldIndexPrivate(boolean value);
2828

2929
public abstract Builder setShouldIndexMethodContent(boolean value);
3030
}

src/main/java/org/javacomp/parser/AstScanner.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ private boolean shouldScanWithModifiers(EntityScope scope, Set<Modifier> modifie
396396
return true;
397397
}
398398
}
399-
if (!indexOptions.shouldIndexNonPublic() && !modifiers.contains(Modifier.PUBLIC)) {
399+
if (!indexOptions.shouldIndexPrivate() && modifiers.contains(Modifier.PRIVATE)) {
400400
return false;
401401
}
402402
return true;

src/main/java/org/javacomp/tool/Indexer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void run(
8585
private void addJavaFile(Path path, Module module, FileManager fileManager) {
8686
Optional<CharSequence> content = fileManager.getFileContent(path);
8787
FileScope fileScope =
88-
new AstScanner(IndexOptions.PUBLIC_READONLY_BUILDER.build())
88+
new AstScanner(IndexOptions.NON_PRIVATE_BUILDER.build())
8989
.startScan(
9090
parserContext.parse(path.toString(), content.get()),
9191
path.toString(),

0 commit comments

Comments
 (0)