Search in sources :

Example 1 with TextConsoleBuilderImpl

use of com.intellij.execution.filters.TextConsoleBuilderImpl in project intellij-plugins by JetBrains.

the class KarmaServerLogComponent method createConsole.

@NotNull
private static ConsoleView createConsole(@NotNull Project project) {
    GlobalSearchScope scope = GlobalSearchScope.allScope(project);
    TextConsoleBuilderImpl builder = new TextConsoleBuilderImpl(project, scope);
    builder.setUsePredefinedMessageFilter(false);
    builder.addFilter(new NodeStackTraceFilter(project));
    return builder.getConsole();
}
Also used : GlobalSearchScope(com.intellij.psi.search.GlobalSearchScope) NodeStackTraceFilter(com.intellij.javascript.nodejs.NodeStackTraceFilter) TextConsoleBuilderImpl(com.intellij.execution.filters.TextConsoleBuilderImpl) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with TextConsoleBuilderImpl

use of com.intellij.execution.filters.TextConsoleBuilderImpl in project intellij by bazelbuild.

the class BlazeJavaRunProfileState method startProcess.

@Override
protected ProcessHandler startProcess() throws ExecutionException {
    Project project = configuration.getProject();
    BlazeCommand.Builder blazeCommand;
    BlazeTestUiSession testUiSession = useTestUi() ? TestUiSessionProvider.getInstance(project).getTestUiSession(configuration.getTarget()) : null;
    if (testUiSession != null) {
        blazeCommand = getBlazeCommandBuilder(project, configuration, testUiSession.getBlazeFlags(), executorType);
        setConsoleBuilder(new TextConsoleBuilderImpl(project) {

            @Override
            protected ConsoleView createConsole() {
                return SmRunnerUtils.getConsoleView(project, configuration, getEnvironment().getExecutor(), testUiSession);
            }
        });
    } else {
        blazeCommand = getBlazeCommandBuilder(project, configuration, ImmutableList.of(), executorType);
    }
    addConsoleFilters(new BlazeTargetFilter(project, true), new IssueOutputFilter(project, WorkspaceRoot.fromProject(project), BlazeInvocationContext.NonSync, false));
    List<String> command = HotSwapUtils.canHotSwap(getEnvironment()) ? getBashCommandsToRunScript(blazeCommand) : blazeCommand.build().toList();
    WorkspaceRoot workspaceRoot = WorkspaceRoot.fromProject(project);
    return new ScopedBlazeProcessHandler(project, command, workspaceRoot, new ScopedBlazeProcessHandler.ScopedProcessHandlerDelegate() {

        @Override
        public void onBlazeContextStart(BlazeContext context) {
            context.push(new IssuesScope(project, BlazeUserSettings.getInstance().getShowProblemsViewForRunAction())).push(new IdeaLogScope());
        }

        @Override
        public ImmutableList<ProcessListener> createProcessListeners(BlazeContext context) {
            LineProcessingOutputStream outputStream = LineProcessingOutputStream.of(BlazeConsoleLineProcessorProvider.getAllStderrLineProcessors(context));
            return ImmutableList.of(new LineProcessingProcessAdapter(outputStream));
        }
    });
}
Also used : IssueOutputFilter(com.google.idea.blaze.base.issueparser.IssueOutputFilter) LineProcessingProcessAdapter(com.google.idea.blaze.base.run.processhandler.LineProcessingProcessAdapter) BlazeCommand(com.google.idea.blaze.base.command.BlazeCommand) ConsoleView(com.intellij.execution.ui.ConsoleView) ImmutableList(com.google.common.collect.ImmutableList) BlazeTargetFilter(com.google.idea.blaze.base.run.filter.BlazeTargetFilter) WorkspaceRoot(com.google.idea.blaze.base.model.primitives.WorkspaceRoot) ScopedBlazeProcessHandler(com.google.idea.blaze.base.run.processhandler.ScopedBlazeProcessHandler) Project(com.intellij.openapi.project.Project) IdeaLogScope(com.google.idea.blaze.base.scope.scopes.IdeaLogScope) BlazeContext(com.google.idea.blaze.base.scope.BlazeContext) IssuesScope(com.google.idea.blaze.base.scope.scopes.IssuesScope) LineProcessingOutputStream(com.google.idea.blaze.base.async.process.LineProcessingOutputStream) BlazeTestUiSession(com.google.idea.blaze.base.run.smrunner.BlazeTestUiSession) TextConsoleBuilderImpl(com.intellij.execution.filters.TextConsoleBuilderImpl)

Example 3 with TextConsoleBuilderImpl

use of com.intellij.execution.filters.TextConsoleBuilderImpl in project intellij-elixir by KronicDeth.

the class MixRunningState method execute.

@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    TextConsoleBuilder consoleBuilder = new TextConsoleBuilderImpl(myConfiguration.getProject()) {

        @Override
        public ConsoleView getConsole() {
            ConsoleView consoleView = super.getConsole();
            ElixirConsoleUtil.attachFilters(myConfiguration.getProject(), consoleView);
            return consoleView;
        }
    };
    setConsoleBuilder(consoleBuilder);
    return super.execute(executor, runner);
}
Also used : TextConsoleBuilder(com.intellij.execution.filters.TextConsoleBuilder) ConsoleView(com.intellij.execution.ui.ConsoleView) TextConsoleBuilderImpl(com.intellij.execution.filters.TextConsoleBuilderImpl) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with TextConsoleBuilderImpl

use of com.intellij.execution.filters.TextConsoleBuilderImpl in project flutter-intellij by flutter.

the class DaemonConsoleView method install.

/**
 * Sets up a launcher to use a DaemonConsoleView.
 */
public static void install(@NotNull CommandLineState launcher, @NotNull ExecutionEnvironment env, @NotNull VirtualFile workDir) {
    // Create our own console builder.
    // We need to filter input to this console without affecting other consoles,
    // so we cannot use a consoleFilterInputProvider.
    final GlobalSearchScope searchScope = SearchScopeProvider.createSearchScope(env.getProject(), env.getRunProfile());
    final TextConsoleBuilder builder = new TextConsoleBuilderImpl(env.getProject(), searchScope) {

        @NotNull
        @Override
        protected ConsoleView createConsole() {
            return new DaemonConsoleView(env.getProject(), searchScope);
        }
    };
    // Set up basic console filters. (More may be added later.)
    builder.addFilter(new DartRelativePathsConsoleFilter(env.getProject(), workDir.getPath()));
    builder.addFilter(new UrlFilter());
    launcher.setConsoleBuilder(builder);
}
Also used : DartRelativePathsConsoleFilter(com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter) TextConsoleBuilder(com.intellij.execution.filters.TextConsoleBuilder) GlobalSearchScope(com.intellij.psi.search.GlobalSearchScope) UrlFilter(com.intellij.execution.filters.UrlFilter) TextConsoleBuilderImpl(com.intellij.execution.filters.TextConsoleBuilderImpl)

Aggregations

TextConsoleBuilderImpl (com.intellij.execution.filters.TextConsoleBuilderImpl)4 TextConsoleBuilder (com.intellij.execution.filters.TextConsoleBuilder)2 ConsoleView (com.intellij.execution.ui.ConsoleView)2 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)2 NotNull (org.jetbrains.annotations.NotNull)2 ImmutableList (com.google.common.collect.ImmutableList)1 LineProcessingOutputStream (com.google.idea.blaze.base.async.process.LineProcessingOutputStream)1 BlazeCommand (com.google.idea.blaze.base.command.BlazeCommand)1 IssueOutputFilter (com.google.idea.blaze.base.issueparser.IssueOutputFilter)1 WorkspaceRoot (com.google.idea.blaze.base.model.primitives.WorkspaceRoot)1 BlazeTargetFilter (com.google.idea.blaze.base.run.filter.BlazeTargetFilter)1 LineProcessingProcessAdapter (com.google.idea.blaze.base.run.processhandler.LineProcessingProcessAdapter)1 ScopedBlazeProcessHandler (com.google.idea.blaze.base.run.processhandler.ScopedBlazeProcessHandler)1 BlazeTestUiSession (com.google.idea.blaze.base.run.smrunner.BlazeTestUiSession)1 BlazeContext (com.google.idea.blaze.base.scope.BlazeContext)1 IdeaLogScope (com.google.idea.blaze.base.scope.scopes.IdeaLogScope)1 IssuesScope (com.google.idea.blaze.base.scope.scopes.IssuesScope)1 UrlFilter (com.intellij.execution.filters.UrlFilter)1 NodeStackTraceFilter (com.intellij.javascript.nodejs.NodeStackTraceFilter)1 Project (com.intellij.openapi.project.Project)1