Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Mark package with BUILD.bazel file in completion #5526

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading