Idea Plugin Console Highlighting


public class RExecutorRunProfileState implements RunProfileState {
    private final ExecutionEnvironment environment;
    private final RExecutorRunConfigurationOptions options;

    public RExecutorRunProfileState(ExecutionEnvironment environment, RExecutorRunConfigurationOptions options) {
        this.environment = environment;
        this.options = options;

    public ExecutionResult execute(Executor executor, @NotNull ProgramRunner<?> runner) {
        final Project project = environment.getProject();

        final String output = toXmlString(result.messages(), true);
       ConsoleView console = createConsole(project);
       console.addMessageFilter(new XMLPatternFilter());
       console.print(output, ConsoleViewContentType.NORMAL_OUTPUT);
       OSProcessHandler processHandler = ProcessHandlerFactory.getInstance()
              .createColoredProcessHandler(new GeneralCommandLine("cmd.exe", "/c", "echo", output));

       return new DefaultExecutionResult(console, processHandler);

    private ConsoleView createConsole(Project project) {
        return TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();

I have a plugin that does xsl conversion. How to highlight XML result in Ideas Console? Are there built-in tools for this? Or will you have to write your own filter?



Could you please clarify your use case? Do you want to highlight the XML syntax like in the editor or something else?


Hi, yes I want to highlight XML syntax like in an editor.



I didn't find any API for such a use case.

Regarding filters, I went through existing filters and didn't find any for coloring the syntax in any language. Most of them handle links to source code, installing tools, rerunning process, etc. so this looks like a main API's purpose. You can try to find something similar to your idea on the IntelliJ Platform Explorer:


Please sign in to leave a comment.