Skip to content

Commit

Permalink
fix: Mark package with BUILD.bazel file in completion
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebarrau committed Oct 24, 2023
1 parent a00e775 commit 5cd29ec
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.google.idea.blaze.base.lang.buildfile.references;

import com.google.common.collect.ImmutableSet;
import com.google.idea.blaze.base.lang.buildfile.completion.FilePathLookupElement;
import com.google.idea.blaze.base.lang.buildfile.psi.BuildFile;
import com.google.idea.blaze.base.lang.buildfile.psi.StringLiteral;
Expand All @@ -38,6 +39,7 @@

/** The data relevant to finding file lookups. */
public class FileLookupData {
private static final ImmutableSet<String> BUILDFILE_NAMES = ImmutableSet.of("BUILD", "BUILD.bazel");

/** The type of path string format */
public enum PathFormat {
Expand Down Expand Up @@ -163,8 +165,10 @@ public FilePathLookupElement lookupElementForFile(
new NullableLazyValue<Icon>() {
@Override
protected Icon compute() {
if (file.findChild("BUILD") != null) {
return BlazeIcons.BuildFile;
for (String buildfileName : BUILDFILE_NAMES) {
if (file.findChild(buildfileName) != null) {
return BlazeIcons.BuildFile;
}
}
if (file.isDirectory()) {
return PlatformIcons.FOLDER_ICON;
Expand Down

0 comments on commit 5cd29ec

Please sign in to comment.