Skip to content

Commit

Permalink
Implement IntellijExtCodeSearchApiClient
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 591061363
  • Loading branch information
Googler authored and copybara-github committed Dec 14, 2023
1 parent 3b7014d commit afc8906
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public class IntelliJExtManager {

private static final BoolExperiment LINTER = new BoolExperiment("use.intellij.ext.linter", false);

private static final BoolExperiment CODESEARCH =
new BoolExperiment("use.intellij.ext.codesearch", false);

private static final BoolExperiment BUILD_SERVICE =
new BoolExperiment("use.intellij.ext.buildservice", false);

Expand Down Expand Up @@ -137,6 +140,10 @@ public boolean isLinterEnabled() {
return isEnabled() && LINTER.getValue();
}

public boolean isCodeSearchEnabled() {
return isEnabled() && CODESEARCH.getValue();
}

public boolean isBuildServiceEnabled() {
return isEnabled() && BUILD_SERVICE.getValue();
}
Expand Down
4 changes: 1 addition & 3 deletions ext/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ java_library(
deps = [
"//ext/proto:intellijext_java_grpc",
"//ext/proto:intellijext_java_proto",
"//intellij_platform_sdk:plugin_api",
"@com_google_guava_guava//jar",
"@io_grpc_grpc_java//core",
"@io_grpc_grpc_java//netty",
"@io_netty_netty_common//jar",
"@io_netty_netty_transport//jar",
"@io_netty_netty_transport_native_unix_common//jar",
] + select({
"@platforms//os:macos": ["@io_netty_netty_transport_classes_kqueue//jar"],
"//conditions:default": ["@io_netty_netty_transport_native_epoll//jar"],
Expand Down
5 changes: 5 additions & 0 deletions ext/src/com/google/idea/blaze/ext/IntelliJExtClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.idea.blaze.ext.BuildServiceGrpc.BuildServiceBlockingStub;
import com.google.idea.blaze.ext.BuildServiceGrpc.BuildServiceFutureStub;
import com.google.idea.blaze.ext.ChatBotModelGrpc.ChatBotModelBlockingStub;
import com.google.idea.blaze.ext.CodeSearchGrpc.CodeSearchFutureStub;
import com.google.idea.blaze.ext.DepServerGrpc.DepServerFutureStub;
import com.google.idea.blaze.ext.ExperimentsServiceGrpc.ExperimentsServiceBlockingStub;
import com.google.idea.blaze.ext.IntelliJExtGrpc.IntelliJExtBlockingStub;
Expand Down Expand Up @@ -111,4 +112,8 @@ public BuildCleanerServiceFutureStub getBuildCleanerService() {
public DepServerFutureStub getDependencyService() {
return DepServerGrpc.newFutureStub(channel);
}

public CodeSearchFutureStub getCodeSearchService() {
return CodeSearchGrpc.newFutureStub(channel);
}
}
6 changes: 6 additions & 0 deletions ext/src/com/google/idea/blaze/ext/IntelliJExtService.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.idea.blaze.ext.BuildServiceGrpc.BuildServiceBlockingStub;
import com.google.idea.blaze.ext.BuildServiceGrpc.BuildServiceFutureStub;
import com.google.idea.blaze.ext.ChatBotModelGrpc.ChatBotModelBlockingStub;
import com.google.idea.blaze.ext.CodeSearchGrpc.CodeSearchFutureStub;
import com.google.idea.blaze.ext.DepServerGrpc.DepServerFutureStub;
import com.google.idea.blaze.ext.ExperimentsServiceGrpc.ExperimentsServiceBlockingStub;
import com.google.idea.blaze.ext.IntelliJExtGrpc.IntelliJExtBlockingStub;
Expand Down Expand Up @@ -183,6 +184,11 @@ public LinterFutureStub getLinterService() throws IOException {
return client.getLinterService();
}

public CodeSearchFutureStub getCodeSearchService() throws IOException {
IntelliJExtBlockingStub unused = connect();
return client.getCodeSearchService();
}

public BuildCleanerServiceFutureStub getBuildCleanerService() {
try {
IntelliJExtBlockingStub unused = connect();
Expand Down

0 comments on commit afc8906

Please sign in to comment.