use of com.intellij.execution.filters.UrlFilter in project intellij-community by JetBrains.
the class JBTabbedTerminalWidget method createInnerTerminalWidget.
@Override
protected JediTermWidget createInnerTerminalWidget(TabbedSettingsProvider settingsProvider) {
JBTerminalWidget widget = new JBTerminalWidget(myProject, mySettingsProvider, myParent);
widget.addMessageFilter(myProject, new UrlFilter());
convertActions(widget, widget.getActions());
convertActions(widget.getTerminalPanel(), widget.getTerminalPanel().getActions(), new Predicate<KeyEvent>() {
@Override
public boolean apply(KeyEvent input) {
widget.getTerminalPanel().handleKeyEvent(input);
return true;
}
});
return widget;
}
use of com.intellij.execution.filters.UrlFilter in project intellij-community by JetBrains.
the class PythonScriptCommandLineState method execute.
@Override
public ExecutionResult execute(Executor executor, PythonProcessStarter processStarter, final CommandLinePatcher... patchers) throws ExecutionException {
if (myConfig.showCommandLineAfterwards() && !myConfig.emulateTerminal()) {
if (executor.getId() == DefaultDebugExecutor.EXECUTOR_ID) {
return super.execute(executor, processStarter, ArrayUtil.append(patchers, new CommandLinePatcher() {
@Override
public void patchCommandLine(GeneralCommandLine commandLine) {
commandLine.getParametersList().getParamsGroup(PythonCommandLineState.GROUP_DEBUGGER).addParameterAt(1, "--cmd-line");
}
}));
}
PythonScriptWithConsoleRunner runner = new PythonScriptWithConsoleRunner(myConfig.getProject(), myConfig.getSdk(), PyConsoleType.PYTHON, myConfig.getWorkingDirectory(), myConfig.getEnvs(), patchers, PyConsoleOptions.getInstance(myConfig.getProject()).getPythonConsoleSettings());
runner.setEnableAfterConnection(false);
runner.runSync();
// runner.getProcessHandler() would be null if execution error occurred
if (runner.getProcessHandler() == null) {
return null;
}
runner.getPydevConsoleCommunication().setConsoleView(runner.getConsoleView());
List<AnAction> actions = Lists.newArrayList(createActions(runner.getConsoleView(), runner.getProcessHandler()));
actions.add(new ShowVarsAction(runner.getConsoleView(), runner.getPydevConsoleCommunication()));
return new DefaultExecutionResult(runner.getConsoleView(), runner.getProcessHandler(), actions.toArray(new AnAction[actions.size()]));
} else if (myConfig.emulateTerminal()) {
setRunWithPty(true);
final ProcessHandler processHandler = startProcess(processStarter, patchers);
TerminalExecutionConsole executeConsole = new TerminalExecutionConsole(myConfig.getProject(), processHandler);
executeConsole.addMessageFilter(myConfig.getProject(), new PythonTracebackFilter(myConfig.getProject()));
executeConsole.addMessageFilter(myConfig.getProject(), new UrlFilter());
processHandler.startNotify();
return new DefaultExecutionResult(executeConsole, processHandler, AnAction.EMPTY_ARRAY);
} else {
return super.execute(executor, processStarter, patchers);
}
}
use of com.intellij.execution.filters.UrlFilter 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);
}
use of com.intellij.execution.filters.UrlFilter 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;
}
Aggregations