mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-236980: Use python traceback filter for terminal.
User may run python code via terminal. Output still should be highlighted. GitOrigin-RevId: dec6bdaaf66af8bf7f72dcde75ef421f2fa760a0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cf0a619739
commit
59ec2f60bb
@@ -344,6 +344,7 @@
|
||||
|
||||
<consoleHistoryModelProvider implementation="com.jetbrains.python.console.PyConsoleHistoryModelProvider"/>
|
||||
<scratch.rootType implementation="com.jetbrains.python.console.PyConsoleRootType" />
|
||||
<consoleFilterProvider implementation="com.jetbrains.python.run.PyMessageFilterProvider"/>
|
||||
|
||||
<!-- Run Anything -->
|
||||
<runAnything.executionProvider order="after RunAnythingRunConfigurationProvider" implementation="com.jetbrains.python.run.runAnything.PyRunAnythingProvider"/>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.python.run
|
||||
|
||||
import com.intellij.execution.filters.ConsoleFilterProvider
|
||||
import com.intellij.openapi.project.Project
|
||||
|
||||
class PyMessageFilterProvider : ConsoleFilterProvider {
|
||||
override fun getDefaultFilters(project: Project) = arrayOf(PythonTracebackFilter(project))
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class PythonTracebackFilter implements Filter {
|
||||
|
||||
public PythonTracebackFilter(final Project project) {
|
||||
myProject = project;
|
||||
myWorkingDirectory = null;
|
||||
myWorkingDirectory = project.getBasePath();
|
||||
}
|
||||
|
||||
public PythonTracebackFilter(final Project project, @Nullable final String workingDirectory) {
|
||||
|
||||
Reference in New Issue
Block a user