Skip to content

Commit

Permalink
Add checks for bazel projects in bazel-only code (#5658)
Browse files Browse the repository at this point in the history
* Disable skylark debugger for non-bazel project

fixes #5655

* Disable AdditionalLanguages notification for non-bazel projects

Fixes #5655
  • Loading branch information
ujohnny authored Nov 9, 2023
1 parent 79d55e7 commit 59ddcbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public Key<EditorNotificationPanel> getKey() {
@Nullable
@Override
public EditorNotificationPanel createNotificationPanel(VirtualFile file, FileEditor fileEditor) {
if (Blaze.getProjectType(project).equals(ProjectType.UNKNOWN)) {
return null;
}

String ext = file.getExtension();
if (ext == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ private SkylarkDebuggingUtils() {}
new BoolExperiment("skylark.debugging.enabled", true);

public static boolean debuggingEnabled(Project project) {
if (Blaze.getProjectType(project).equals(ProjectType.UNKNOWN)) {
return false;
}

if (Blaze.getProjectType(project).equals(ProjectType.QUERY_SYNC)) {
// Skylark debugging only needs a blaze version past EARLIEST_SUPPORTED_BLAZE_CL, which
// greatly predates query sync
Expand Down

0 comments on commit 59ddcbe

Please sign in to comment.