Skip to content

Commit

Permalink
Fix 'Non-blaze project is provided' error in GoLand
Browse files Browse the repository at this point in the history
  • Loading branch information
tpasternak committed Nov 21, 2023
1 parent 70b22e7 commit d95e6b8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import com.google.idea.blaze.base.ideinfo.TargetMap;
import com.google.idea.blaze.base.model.BlazeProjectData;
import com.google.idea.blaze.base.model.primitives.Label;
import com.google.idea.blaze.base.settings.Blaze;
import com.google.idea.blaze.base.settings.BlazeImportSettings;
import com.google.idea.blaze.base.sync.SyncCache;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VfsUtil;
Expand All @@ -41,6 +43,9 @@ public class BlazeGoPackageFactory implements GoPackageFactory {
@Nullable
@Override
public GoPackage createPackage(GoFile goFile) {
if (Blaze.getProjectType(goFile.getProject()) == BlazeImportSettings.ProjectType.UNKNOWN) {
return null;
}
VirtualFile virtualFile = goFile.getVirtualFile();
if (virtualFile == null) {
return null;
Expand Down

0 comments on commit d95e6b8

Please sign in to comment.