Search in sources :

Example 1 with DartRelativePathsConsoleFilter

use of com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter in project intellij-plugins by JetBrains.

the class PubServerService method configureConsole.

@Override
protected void configureConsole(@NotNull final TextConsoleBuilder consoleBuilder) {
    consoleBuilder.addFilter(new DartConsoleFilter(getProject(), firstServedDir));
    consoleBuilder.addFilter(new DartRelativePathsConsoleFilter(getProject(), firstServedDir.getParent().getPath()));
    consoleBuilder.addFilter(new UrlFilter());
}
Also used : DartRelativePathsConsoleFilter(com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter) DartConsoleFilter(com.jetbrains.lang.dart.ide.runner.DartConsoleFilter) UrlFilter(com.intellij.execution.filters.UrlFilter)

Example 2 with DartRelativePathsConsoleFilter

use of com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter in project intellij-plugins by JetBrains.

the class DartPubActionBase method createConsole.

@NotNull
private static ConsoleView createConsole(@NotNull final Project project, @NotNull final VirtualFile pubspecYamlFile) {
    final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
    consoleBuilder.setViewer(true);
    consoleBuilder.addFilter(new DartConsoleFilter(project, pubspecYamlFile));
    consoleBuilder.addFilter(new DartRelativePathsConsoleFilter(project, pubspecYamlFile.getParent().getPath()));
    consoleBuilder.addFilter(new UrlFilter());
    return consoleBuilder.getConsole();
}
Also used : DartRelativePathsConsoleFilter(com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter) TextConsoleBuilder(com.intellij.execution.filters.TextConsoleBuilder) DartConsoleFilter(com.jetbrains.lang.dart.ide.runner.DartConsoleFilter) UrlFilter(com.intellij.execution.filters.UrlFilter) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with DartRelativePathsConsoleFilter

use of com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter in project intellij-plugins by JetBrains.

the class DartTestRunningState method createConsole.

private static ConsoleView createConsole(@NotNull ExecutionEnvironment env) {
    final Project project = env.getProject();
    final DartRunConfiguration runConfiguration = (DartRunConfiguration) env.getRunProfile();
    final DartTestRunnerParameters runnerParameters = (DartTestRunnerParameters) runConfiguration.getRunnerParameters();
    final TestConsoleProperties testConsoleProperties = new DartConsoleProperties(runConfiguration, env);
    final ConsoleView consoleView = SMTestRunnerConnectionUtil.createConsole(DART_FRAMEWORK_NAME, testConsoleProperties);
    try {
        final VirtualFile dartFile = runnerParameters.getDartFileOrDirectory();
        consoleView.addMessageFilter(new DartConsoleFilter(project, dartFile));
        consoleView.addMessageFilter(new DartRelativePathsConsoleFilter(project, runnerParameters.computeProcessWorkingDirectory(project)));
        consoleView.addMessageFilter(new UrlFilter());
    } catch (RuntimeConfigurationError ignore) {
    /* can't happen because already checked */
    }
    Disposer.register(project, consoleView);
    return consoleView;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) DartRelativePathsConsoleFilter(com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter) Project(com.intellij.openapi.project.Project) DartRunConfiguration(com.jetbrains.lang.dart.ide.runner.base.DartRunConfiguration) SMTRunnerConsoleView(com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView) ConsoleView(com.intellij.execution.ui.ConsoleView) DartConsoleFilter(com.jetbrains.lang.dart.ide.runner.DartConsoleFilter) UrlFilter(com.intellij.execution.filters.UrlFilter) RuntimeConfigurationError(com.intellij.execution.configurations.RuntimeConfigurationError) TestConsoleProperties(com.intellij.execution.testframework.TestConsoleProperties)

Example 4 with DartRelativePathsConsoleFilter

use of com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter 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)

Example 5 with DartRelativePathsConsoleFilter

use of com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter in project flutter-intellij by flutter.

the class TestLaunchState method createConsole.

@Nullable
@Override
protected ConsoleView createConsole(@NotNull Executor executor) throws ExecutionException {
    if (!testConsoleEnabled) {
        return super.createConsole(executor);
    }
    // Create a console showing a test tree.
    final Project project = getEnvironment().getProject();
    final DartUrlResolver resolver = DartUrlResolver.getInstance(project, testFileOrDir);
    final ConsoleProps props = new ConsoleProps(config, executor, resolver);
    final BaseTestsOutputConsoleView console = SMTestRunnerConnectionUtil.createConsole("FlutterTestRunner", props);
    final Module module = ModuleUtil.findModuleForFile(testFileOrDir, project);
    if (module != null) {
        console.addMessageFilter(new FlutterConsoleFilter(module));
    }
    final String baseDir = getBaseDir();
    if (baseDir != null) {
        console.addMessageFilter(new DartRelativePathsConsoleFilter(project, baseDir));
    }
    console.addMessageFilter(new UrlFilter());
    return console;
}
Also used : DartRelativePathsConsoleFilter(com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter) Project(com.intellij.openapi.project.Project) FlutterConsoleFilter(io.flutter.console.FlutterConsoleFilter) DartUrlResolver(com.jetbrains.lang.dart.util.DartUrlResolver) UrlFilter(com.intellij.execution.filters.UrlFilter) BaseTestsOutputConsoleView(com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView) Module(com.intellij.openapi.module.Module) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

UrlFilter (com.intellij.execution.filters.UrlFilter)5 DartRelativePathsConsoleFilter (com.jetbrains.lang.dart.ide.runner.DartRelativePathsConsoleFilter)5 DartConsoleFilter (com.jetbrains.lang.dart.ide.runner.DartConsoleFilter)3 TextConsoleBuilder (com.intellij.execution.filters.TextConsoleBuilder)2 Project (com.intellij.openapi.project.Project)2 RuntimeConfigurationError (com.intellij.execution.configurations.RuntimeConfigurationError)1 TextConsoleBuilderImpl (com.intellij.execution.filters.TextConsoleBuilderImpl)1 TestConsoleProperties (com.intellij.execution.testframework.TestConsoleProperties)1 SMTRunnerConsoleView (com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView)1 BaseTestsOutputConsoleView (com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView)1 ConsoleView (com.intellij.execution.ui.ConsoleView)1 Module (com.intellij.openapi.module.Module)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 DartRunConfiguration (com.jetbrains.lang.dart.ide.runner.base.DartRunConfiguration)1 DartUrlResolver (com.jetbrains.lang.dart.util.DartUrlResolver)1 FlutterConsoleFilter (io.flutter.console.FlutterConsoleFilter)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1