Skip to content

Commit

Permalink
Skip unknown sections
Browse files Browse the repository at this point in the history
  • Loading branch information
guw committed Aug 13, 2023
1 parent 5cda115 commit c0cd222
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import java.util.stream.Stream;

import org.eclipse.core.runtime.IPath;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.idea.blaze.base.model.primitives.InvalidTargetException;
import com.google.idea.blaze.base.model.primitives.TargetExpression;
Expand Down Expand Up @@ -126,6 +128,8 @@ public ImportHandle startImporting(Path bazelProjectViewFile) throws IOException
}
}

private static Logger LOG = LoggerFactory.getLogger(BazelProjectFileReader.BazelProjectViewBuilder.class);

private static final Pattern SECTION_HEADER_REGEX = Pattern.compile("((^[^:\\-/*\\s]+)([: ]))", Pattern.MULTILINE);
private static final Pattern WHITESPACE_CHAR_REGEX = Pattern.compile("\\s+");
private static final String COMMENT_LINE_REGEX = "#(.)*(\\n|\\z)";
Expand Down Expand Up @@ -292,7 +296,7 @@ private void parseProjectFile(Path bazelProjectFile, BazelProjectViewBuilder bui
break;
}
default:
throw new IllegalArgumentException("Unexpected value: " + rawSection.getName());
LOG.warn("Unexpected section '{}' while reading '{}'", rawSection.getName(), bazelProjectFile);
}
}
}
Expand Down

0 comments on commit c0cd222

Please sign in to comment.