Search in sources :

Example 26 with IssueOutput

use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.

the class IssueOutputLineProcessor method processLine.

@Override
public boolean processLine(String line) {
    IssueOutput issue = blazeIssueParser.parseIssue(line);
    if (issue != null) {
        if (issue.getCategory() == IssueOutput.Category.ERROR) {
            context.setHasError();
        }
        context.output(issue);
    }
    OutputType outputType = issue == null ? OutputType.NORMAL : OutputType.ERROR;
    context.output(new PrintOutput(line, outputType));
    return true;
}
Also used : PrintOutput(com.google.idea.blaze.base.scope.output.PrintOutput) IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) OutputType(com.google.idea.blaze.base.scope.output.PrintOutput.OutputType)

Example 27 with IssueOutput

use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.

the class ProjectViewUi method parseProjectView.

public ProjectViewSet parseProjectView(final List<IssueOutput> issues) {
    final String projectViewText = projectViewEditor.getDocument().getText();
    final OutputSink<IssueOutput> issueCollector = output -> {
        issues.add(output);
        return OutputSink.Propagation.Continue;
    };
    return Scope.root(context -> {
        context.addOutputSink(IssueOutput.class, issueCollector);
        ProjectViewParser projectViewParser = new ProjectViewParser(context, workspacePathResolver);
        projectViewParser.parseProjectView(projectViewText);
        return projectViewParser.getResult();
    });
}
Also used : UIManager(javax.swing.UIManager) WriteAction(com.intellij.openapi.application.WriteAction) EditorFactoryImpl(com.intellij.openapi.editor.impl.EditorFactoryImpl) ProjectViewLanguage(com.google.idea.blaze.base.lang.projectview.language.ProjectViewLanguage) Document(com.intellij.openapi.editor.Document) PsiManagerEx(com.intellij.psi.impl.PsiManagerEx) JBLabel(com.intellij.ui.components.JBLabel) PsiManager(com.intellij.psi.PsiManager) OutputSink(com.google.idea.blaze.base.scope.OutputSink) UiUtil(com.google.idea.blaze.base.ui.UiUtil) BuildSystem(com.google.idea.blaze.base.settings.Blaze.BuildSystem) ProjectManager(com.intellij.openapi.project.ProjectManager) Scope(com.google.idea.blaze.base.scope.Scope) IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) Disposer(com.intellij.openapi.util.Disposer) Project(com.intellij.openapi.project.Project) EditorEx(com.intellij.openapi.editor.ex.EditorEx) WorkspacePathResolver(com.google.idea.blaze.base.sync.workspace.WorkspacePathResolver) DataManager(com.intellij.ide.DataManager) DocumentImpl(com.intellij.openapi.editor.impl.DocumentImpl) Nullable(javax.annotation.Nullable) LightVirtualFile(com.intellij.testFramework.LightVirtualFile) Blaze(com.google.idea.blaze.base.settings.Blaze) FileManager(com.intellij.psi.impl.file.impl.FileManager) ProjectViewParser(com.google.idea.blaze.base.projectview.parser.ProjectViewParser) ProjectViewFileType(com.google.idea.blaze.base.lang.projectview.language.ProjectViewFileType) FileDocumentManagerImpl(com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl) Disposable(com.intellij.openapi.Disposable) Dimension(java.awt.Dimension) List(java.util.List) EditorColors(com.intellij.openapi.editor.colors.EditorColors) KeyboardFocusManager(java.awt.KeyboardFocusManager) ProjectImpl(com.intellij.openapi.project.impl.ProjectImpl) MutablePicoContainer(org.picocontainer.MutablePicoContainer) WorkspacePathResolverProvider(com.google.idea.blaze.base.sync.workspace.WorkspacePathResolverProvider) Result(com.intellij.openapi.application.Result) ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet) EditorFactory(com.intellij.openapi.editor.EditorFactory) JCheckBox(javax.swing.JCheckBox) EditorSettings(com.intellij.openapi.editor.EditorSettings) WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) UndoUtil(com.intellij.openapi.command.undo.UndoUtil) NotNull(org.jetbrains.annotations.NotNull) JPanel(javax.swing.JPanel) IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) ProjectViewParser(com.google.idea.blaze.base.projectview.parser.ProjectViewParser)

Aggregations

IssueOutput (com.google.idea.blaze.base.scope.output.IssueOutput)27 Test (org.junit.Test)19 Nullable (javax.annotation.Nullable)4 ProjectViewSet (com.google.idea.blaze.base.projectview.ProjectViewSet)3 File (java.io.File)3 List (java.util.List)3 WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)2 WorkspaceRoot (com.google.idea.blaze.base.model.primitives.WorkspaceRoot)2 ProjectViewFile (com.google.idea.blaze.base.projectview.ProjectViewSet.ProjectViewFile)2 ProjectViewParser (com.google.idea.blaze.base.projectview.parser.ProjectViewParser)2 DirectoryEntry (com.google.idea.blaze.base.projectview.section.sections.DirectoryEntry)2 Scope (com.google.idea.blaze.base.scope.Scope)2 BuildSystem (com.google.idea.blaze.base.settings.Blaze.BuildSystem)2 WorkspacePathResolver (com.google.idea.blaze.base.sync.workspace.WorkspacePathResolver)2 BlazeValidationError (com.google.idea.blaze.base.ui.BlazeValidationError)2 BlazeValidationResult (com.google.idea.blaze.base.ui.BlazeValidationResult)2 UiUtil (com.google.idea.blaze.base.ui.UiUtil)2 ProjectDataDirectoryValidator (com.google.idea.blaze.base.wizard2.ProjectDataDirectoryValidator)2 Disposable (com.intellij.openapi.Disposable)2 Logger (com.intellij.openapi.diagnostic.Logger)2