<codeInsight.lineMarkerProvider language="Python" implementationClass="com.jetbrains.python.edu.PyDebugFileLineMarkerProvider"/>
<codeInsight.lineMarkerProvider language="Python" implementationClass="com.jetbrains.python.edu.PyExecuteFileLineMarkerProvider"/>
<programRunner implementation="com.jetbrains.python.edu.debugger.PyEduDebugRunner"/>
- <executor implementation="com.jetbrains.python.edu.debugger.PyEduDebugExecutor" order="first,after run"/>>
+ <executor implementation="com.jetbrains.python.edu.debugger.PyEduDebugExecutor" order="first,after run"/>
+ <consoleInputFilterProvider implementation="com.jetbrains.python.edu.debugger.PyEduConsoleInputFilterProvider"/>
</extensions>
<extensions defaultExtensionNs="Pythonid">
- <pyDebugValueTransformer implementation="com.jetbrains.python.edu.debugger.PyEduDebugTransformer"/>
- <pyFramesTransformer implementation="com.jetbrains.python.edu.debugger.PyEduFramesTransformer"/>
- <pyConsoleOutputFilter implementation="com.jetbrains.python.edu.debugger.PyEduConsoleOutputFilter"/>
+ <debugValueTransformer implementation="com.jetbrains.python.edu.debugger.PyEduDebugTransformer"/>
</extensions>
<actions>
ActionManager actionManager = ActionManager.getInstance();
AnAction action = actionManager.getAction(actionId);
if (action != null) {
- ((DefaultActionGroup)actionManager.getAction(groupId)).remove(action);
- actionManager.unregisterAction(actionId);
+ AnAction actionGroup = actionManager.getAction(groupId);
+ if (actionGroup != null && actionGroup instanceof DefaultActionGroup) {
+ ((DefaultActionGroup)actionGroup).remove(action);
+ actionManager.unregisterAction(actionId);
+ }
}
}
import com.intellij.psi.PsiComment;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiWhiteSpace;
-import com.intellij.util.containers.Predicate;
import com.jetbrains.python.psi.PyFile;
import com.jetbrains.python.psi.PyImportStatement;
import com.jetbrains.python.psi.PyStatement;
-import org.jetbrains.annotations.Nullable;
public class PyEduUtils {
-
public static boolean isFirstCodeLine(PsiElement element) {
- return isFirstCodeLine(element, DEFAULT_CONDITION);
- }
-
- public static boolean isFirstCodeLine(PsiElement element, Predicate<PsiElement> isNothing) {
return element instanceof PyStatement &&
element.getParent() instanceof PyFile &&
- !isNothing.apply(element) &&
- nothingBefore(element, isNothing);
+ !isNothing(element) &&
+ nothingBefore(element);
}
- private static boolean nothingBefore(PsiElement element, Predicate<PsiElement> isNothing) {
+ private static boolean nothingBefore(PsiElement element) {
element = element.getPrevSibling();
while (element != null) {
- if (!isNothing.apply(element)) {
+ if (!isNothing(element)) {
return false;
}
element = element.getPrevSibling();
return true;
}
- private static Predicate<PsiElement> DEFAULT_CONDITION = new Predicate<PsiElement>() {
- @Override
- public boolean apply(@Nullable PsiElement element) {
- return (element instanceof PsiComment) || (element instanceof PyImportStatement) || (element instanceof PsiWhiteSpace);
- }
- };
+ private static boolean isNothing(PsiElement element) {
+ return (element instanceof PsiComment) || (element instanceof PyImportStatement) || (element instanceof PsiWhiteSpace);
+ }
}
public void update(AnActionEvent e) {
Presentation presentation = e.getPresentation();
final ConfigurationContext context = ConfigurationContext.getFromContext(e.getDataContext());
+ if (context.findExisting() == null && context.getConfiguration() == null) {
+ return;
+ }
Location location = context.getLocation();
if (location != null && location.getPsiElement().getContainingFile() != null && location.getPsiElement().getContainingFile().getFileType() == PythonFileType.INSTANCE) {
presentation.setEnabled(true);
+++ /dev/null
-package com.jetbrains.python.edu.debugger;
-
-import com.intellij.execution.ui.ConsoleViewContentType;
-import com.jetbrains.python.console.PyConsoleOutputFilter;
-import org.jetbrains.annotations.NotNull;
-
-public class PyEduConsoleOutputFilter implements PyConsoleOutputFilter {
- @Override
- public boolean reject(@NotNull String text, @NotNull ConsoleViewContentType outputType) {
- if (outputType.equals(ConsoleViewContentType.SYSTEM_OUTPUT) && !text.contains("exit code")) {
- return true;
- }
- if (text.startsWith("pydev debugger")) {
- return true;
- }
- return false;
- }
-}
@Override
public String getContextActionId() {
- return "EduDebugClass";
+ return "EduDebug";
}
@NotNull
--- /dev/null
+package com.jetbrains.python.edu.debugger;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+import com.intellij.execution.process.ProcessHandler;
+import com.intellij.execution.ui.ExecutionConsole;
+import com.intellij.xdebugger.XDebugSession;
+import com.jetbrains.python.PythonHelpersLocator;
+import com.jetbrains.python.debugger.*;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.net.ServerSocket;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+class PyEduDebugProcess extends PyDebugProcess {
+
+ private final String myScriptName;
+ private final int myLine;
+
+ public PyEduDebugProcess(@NotNull XDebugSession session,
+ @NotNull ServerSocket serverSocket,
+ @NotNull ExecutionConsole executionConsole,
+ @Nullable ProcessHandler processHandler, boolean multiProcess,
+ String scriptName,
+ int line) {
+ super(session, serverSocket, executionConsole, processHandler, multiProcess);
+ myScriptName = scriptName;
+ myLine = line;
+ }
+
+ @Override
+ public PyStackFrame createStackFrame(PyStackFrameInfo frameInfo) {
+ return new PyEduStackFrame(getSession().getProject(), this, frameInfo,
+ getPositionConverter().convertFromPython(frameInfo.getPosition()));
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ addTemporaryBreakpoint(PyLineBreakpointType.ID, myScriptName, myLine);
+ }
+
+ @NotNull
+ @Override
+ protected PySuspendContext createSuspendContext(PyThreadInfo threadInfo) {
+ threadInfo.updateState(threadInfo.getState(), new ArrayList<PyStackFrameInfo>(filterFrames(threadInfo.getFrames())));
+ return new PySuspendContext(this, threadInfo);
+ }
+
+ public Collection<PyStackFrameInfo> filterFrames(@Nullable List<PyStackFrameInfo> frames) {
+ if (frames == null) {
+ return Collections.emptyList();
+ }
+ final String debugger = PythonHelpersLocator.getHelperPath(PyDebugRunner.DEBUGGER_MAIN);
+ return Collections2.filter(frames, new Predicate<PyStackFrameInfo>() {
+ @Override
+ public boolean apply(PyStackFrameInfo frame) {
+ String file = frame.getPosition().getFile();
+ return !debugger.equals(file);
+ }
+ });
+ }
+}
package com.jetbrains.python.edu.debugger;
-import com.intellij.codeInsight.daemon.impl.CollectHighlightsUtil;
import com.intellij.execution.ExecutionResult;
import com.intellij.execution.Executor;
import com.intellij.execution.configurations.RunProfile;
import com.intellij.execution.configurations.RunProfileState;
import com.intellij.execution.filters.UrlFilter;
import com.intellij.execution.process.ProcessHandler;
+import com.intellij.execution.runners.ExecutionEnvironment;
import com.intellij.execution.ui.ExecutionConsole;
import com.intellij.execution.ui.RunnerLayoutUi;
import com.intellij.execution.ui.layout.PlaceInGrid;
import com.intellij.icons.AllIcons;
-import com.intellij.ide.DataManager;
-import com.intellij.openapi.actionSystem.ActionPlaces;
-import com.intellij.openapi.actionSystem.AnAction;
-import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.Presentation;
+import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.psi.*;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentManager;
-import com.intellij.util.containers.Predicate;
import com.intellij.xdebugger.XDebugSession;
-import com.intellij.xdebugger.XDebuggerManager;
-import com.intellij.xdebugger.breakpoints.XBreakpointManager;
-import com.intellij.xdebugger.breakpoints.XBreakpointProperties;
+import com.intellij.xdebugger.XDebuggerBundle;
import com.intellij.xdebugger.impl.XDebugSessionImpl;
-import com.intellij.xdebugger.impl.breakpoints.LineBreakpointState;
-import com.intellij.xdebugger.impl.breakpoints.XBreakpointManagerImpl;
-import com.intellij.xdebugger.impl.breakpoints.XLineBreakpointImpl;
import com.intellij.xdebugger.impl.ui.XDebugSessionTab;
-import com.jetbrains.python.PyBundle;
import com.jetbrains.python.console.PythonDebugLanguageConsoleView;
-import com.jetbrains.python.debugger.*;
-import com.jetbrains.python.documentation.DocStringUtil;
-import com.jetbrains.python.edu.PyEduUtils;
-import com.jetbrains.python.psi.PyExpression;
-import com.jetbrains.python.psi.PyExpressionStatement;
-import com.jetbrains.python.psi.PyImportStatement;
+import com.jetbrains.python.debugger.PyDebugProcess;
+import com.jetbrains.python.debugger.PyDebugRunner;
+import com.jetbrains.python.debugger.PyLineBreakpointType;
import com.jetbrains.python.run.PythonCommandLineState;
+import com.jetbrains.python.run.PythonRunConfiguration;
import com.jetbrains.python.run.PythonTracebackFilter;
import com.jetbrains.python.sdk.PythonSdkType;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.net.ServerSocket;
-import java.util.List;
public class PyEduDebugRunner extends PyDebugRunner {
-
- public static final Predicate<PsiElement> IS_NOTHING = new Predicate<PsiElement>() {
- @Override
- public boolean apply(@Nullable PsiElement input) {
- return (input instanceof PsiComment) ||
- (input instanceof PyImportStatement) ||
- (input instanceof PsiWhiteSpace) ||
- (isDocString(input));
- }
- };
public static final String OUTPUT = "Output";
+ private static final Logger LOG = Logger.getInstance(PyEduDebugRunner.class);
+ public static final int NO_LINE = -1;
@Override
public boolean canRun(@NotNull String executorId, @NotNull RunProfile profile) {
ServerSocket serverSocket,
ExecutionResult result,
PythonCommandLineState pyState) {
-
- return new PyEduDebugProcess(session, serverSocket, result.getExecutionConsole(), result.getProcessHandler(),
- pyState.isMultiprocessDebug());
+ ExecutionConsole executionConsole = result.getExecutionConsole();
+ ProcessHandler processHandler = result.getProcessHandler();
+ boolean isMultiProcess = pyState.isMultiprocessDebug();
+ String scriptName = getScriptName(pyState);
+ if (scriptName != null) {
+ VirtualFile file = VfsUtil.findFileByIoFile(new File(scriptName), true);
+ if (file != null) {
+ int line = getBreakpointLineNumber(file, session.getProject());
+ if (line != NO_LINE) {
+ return new PyEduDebugProcess(session, serverSocket,
+ executionConsole, processHandler,
+ isMultiProcess, scriptName, line + 1);
+ }
+ }
+ }
+ LOG.info("Failed to create PyEduDebugProcess. PyDebugProcess created instead.");
+ return new PyDebugProcess(session, serverSocket, executionConsole,
+ processHandler, isMultiProcess);
}
- @Override
- protected void initDebugProcess(String name, PyDebugProcess pyDebugProcess) {
- VirtualFile file = VfsUtil.findFileByIoFile(new File(name), true);
- assert file != null;
-
- final Project project = pyDebugProcess.getProject();
- PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
-
- assert psiFile != null;
+ @Nullable
+ private static String getScriptName(PythonCommandLineState pyState) {
+ ExecutionEnvironment environment = pyState.getEnvironment();
+ if (environment == null) {
+ return null;
+ }
+ RunProfile runProfile = environment.getRunProfile();
+ if (runProfile instanceof PythonRunConfiguration) {
+ return ((PythonRunConfiguration)runProfile).getScriptName();
+ }
+ return null;
+ }
- List<PsiElement> psiElements = CollectHighlightsUtil.getElementsInRange(psiFile, 0, psiFile.getTextLength());
- for (PsiElement element : psiElements) {
- if (PyEduUtils.isFirstCodeLine(element, IS_NOTHING)) {
- int offset = element.getTextRange().getStartOffset();
- Document document = FileDocumentManager.getInstance().getDocument(file);
- assert document != null;
- int line = document.getLineNumber(offset) + 1;
- PySourcePosition sourcePosition = pyDebugProcess.getPositionConverter().create(file.getPath(), line);
- XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager();
- PyLineBreakpointType type = new PyLineBreakpointType();
- XBreakpointProperties properties = type.createBreakpointProperties(file, line);
- LineBreakpointState<XBreakpointProperties>
- breakpointState =
- new LineBreakpointState<XBreakpointProperties>(true, type.getId(), file.getUrl(), line, false, file.getTimeStamp());
- pyDebugProcess.addBreakpoint(sourcePosition, new XLineBreakpointImpl<XBreakpointProperties>(type,
- ((XBreakpointManagerImpl)breakpointManager),
- properties, breakpointState));
+ /**
+ * @return the smallest line (from 0 to line number) suitable to set breakpoint on it, NO_LINE if there is no such line in the file
+ */
+ private static int getBreakpointLineNumber(@NotNull final VirtualFile file, @NotNull final Project project) {
+ Document document = FileDocumentManager.getInstance().getDocument(file);
+ if (document == null) {
+ return NO_LINE;
+ }
+ PyLineBreakpointType lineBreakpointType = new PyLineBreakpointType();
+ for (int line = 0; line < document.getLineCount(); line++) {
+ if (lineBreakpointType.canPutAt(file, line, project)) {
+ return line;
}
}
+ return NO_LINE;
}
if (tab != null) {
RunnerLayoutUi ui = tab.getUi();
ContentManager contentManager = ui.getContentManager();
- Content content = findContent(contentManager, "Watches");
+ Content content = findContent(contentManager, XDebuggerBundle.message("debugger.session.tab.watches.title"));
if (content != null) {
contentManager.removeContent(content, true);
}
- content = findContent(contentManager, "Console");
+ content = findContent(contentManager, XDebuggerBundle.message("debugger.session.tab.console.content.name"));
if (content != null) {
contentManager.removeContent(content, true);
}
view.addMessageFilter(new PythonTracebackFilter(project));
view.addMessageFilter(new UrlFilter());
- switchToPythonConsole(view);
+ view.enableConsole(false);
Content eduConsole =
- ui.createContent(OUTPUT, view.getComponent() , OUTPUT, AllIcons.Debugger.ToolConsole, view.getPreferredFocusableComponent());
+ ui.createContent(OUTPUT, view.getComponent(), OUTPUT, AllIcons.Debugger.ToolConsole, view.getPreferredFocusableComponent());
eduConsole.setCloseable(false);
ui.addContent(eduConsole, 0, PlaceInGrid.right, false);
PyDebugRunner.initDebugConsoleView(project, process, view, processHandler, session);
}
- private static void switchToPythonConsole(PythonDebugLanguageConsoleView view) {
- AnAction[] actions = view.createConsoleActions();
- for (AnAction action : actions) {
- Presentation presentation = action.getTemplatePresentation();
- String text = presentation.getText();
- if (PyBundle.message("run.configuration.show.command.line.action.name").equals(text)) {
- AnActionEvent event =
- AnActionEvent.createFromAnAction(action, null,
- ActionPlaces.DEBUGGER_TOOLBAR, DataManager.getInstance().getDataContext(view));
- action.actionPerformed(event);
- }
- }
- }
-
@Nullable
private static Content findContent(ContentManager manager, String name) {
for (Content content : manager.getContents()) {
}
return null;
}
-
-
- private static boolean isDocString(PsiElement element) {
- if (element instanceof PyExpressionStatement) {
- element = ((PyExpressionStatement)element).getExpression();
- }
- if (element instanceof PyExpression) {
- return DocStringUtil.isDocStringExpression((PyExpression)element);
- }
- return false;
- }
-
- private static class PyEduDebugProcess extends PyDebugProcess {
- public PyEduDebugProcess(@NotNull XDebugSession session,
- @NotNull ServerSocket serverSocket,
- @NotNull ExecutionConsole executionConsole,
- @Nullable ProcessHandler processHandler, boolean multiProcess) {
- super(session, serverSocket, executionConsole, processHandler, multiProcess);
- }
-
- @Override
- public PyStackFrame createStackFrame(PyStackFrameInfo frameInfo) {
- return new PyEduStackFrame(getSession().getProject(), this, frameInfo,
- getPositionConverter().convertFromPython(frameInfo.getPosition()));
- }
- }
}
\ No newline at end of file
+++ /dev/null
-package com.jetbrains.python.edu.debugger;
-
-import com.jetbrains.python.PythonHelpersLocator;
-import com.jetbrains.python.debugger.PyDebugRunner;
-import com.jetbrains.python.debugger.PyFramesTransformer;
-import com.jetbrains.python.debugger.PyStackFrameInfo;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class PyEduFramesTransformer implements PyFramesTransformer {
- @Nullable
- @Override
- public List<PyStackFrameInfo> transformFrames(@Nullable List<PyStackFrameInfo> frames) {
- if (frames == null) {
- return null;
- }
- String debugger = PythonHelpersLocator.getHelperPath(PyDebugRunner.DEBUGGER_MAIN);
- List<PyStackFrameInfo> newFrames = new ArrayList<PyStackFrameInfo>();
- for (PyStackFrameInfo frame : frames) {
- String file = frame.getPosition().getFile();
- if (!debugger.equals(file)) {
- newFrames.add(frame);
- }
- }
- return newFrames;
- }
-}
import java.util.Map;
+/**
+ * Represents debug value for content that should be hidden from the python beginners
+ * (e.g. values named with double underscore prefix and postfix)
+ */
public class PyEduMagicDebugValue extends XNamedValue {
private final Map<String, XValue> myValues;
public class PyEduStackFrame extends PyStackFrame {
public static final String MODULE = "<module>";
- public static final String GLOBAL_FRAME = "Global Frame";
+ public static final String GLOBAL_FRAME = "Globals";
private final PyStackFrameInfo myFrameInfo;
private final XSourcePosition myPosition;
+++ /dev/null
-package com.jetbrains.python.debugger;
-
-import com.intellij.openapi.extensions.ExtensionPointName;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.List;
-
-public interface PyFramesTransformer {
- ExtensionPointName<PyFramesTransformer> EP_NAME = ExtensionPointName.create("Pythonid.pyFramesTransformer");
-
- @Nullable
- List<PyStackFrameInfo> transformFrames(@Nullable List<PyStackFrameInfo> frames);
-}
package com.jetbrains.python.debugger;
-import com.intellij.openapi.extensions.Extensions;
import com.jetbrains.python.debugger.pydev.AbstractCommand;
import org.jetbrains.annotations.Nullable;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
String message) {
myId = id;
myName = name;
- myFrames = prepareFrames(frames);
+ myFrames = (frames != null && frames.size() > 0 ? Collections.unmodifiableList(frames) : null);
myStopReason = stopReason;
myMessage = message;
}
- private static List<PyStackFrameInfo> prepareFrames(List<PyStackFrameInfo> frames) {
- if (frames == null) {
- return null;
- }
- List<PyStackFrameInfo> framesCopy = new ArrayList<PyStackFrameInfo>(frames);
- for (PyFramesTransformer transformer: Extensions.getExtensions(PyFramesTransformer.EP_NAME)) {
- framesCopy = transformer.transformFrames(framesCopy);
- }
- return framesCopy != null && framesCopy.size() > 0 ? Collections.unmodifiableList(framesCopy) : null;
- }
-
public String getId() {
return myId;
}
public synchronized void updateState(final State state, final List<PyStackFrameInfo> frames) {
myState = state;
- myFrames = prepareFrames(frames);
+ myFrames = (frames != null && frames.size() > 0 ? Collections.unmodifiableList(frames) : null);
}
<extensionPoint qualifiedName="Pythonid.breakpointHandler" interface="com.jetbrains.python.debugger.PyBreakpointHandlerFactory"/>
<extensionPoint qualifiedName="Pythonid.consoleOptionsProvider" interface="com.jetbrains.python.console.PyConsoleOptionsProvider"/>
<extensionPoint qualifiedName="Pythonid.pyRootTypeProvider" interface="com.jetbrains.python.module.PyRootTypeProvider"/>
- <extensionPoint qualifiedName="Pythonid.pyDebugValueTransformer" interface="com.jetbrains.python.debugger.PyDebugValueTransformer"/>
- <extensionPoint qualifiedName="Pythonid.pyFramesTransformer" interface="com.jetbrains.python.debugger.PyFramesTransformer"/>
- <extensionPoint qualifiedName="Pythonid.pyConsoleOutputFilter" interface="com.jetbrains.python.console.PyConsoleOutputFilter"/>
+ <extensionPoint qualifiedName="Pythonid.debugValueTransformer" interface="com.jetbrains.python.debugger.PyDebugValueTransformer"/>
</extensionPoints>
<extensions defaultExtensionNs="Pythonid">
+++ /dev/null
-/*
- * Copyright 2000-2015 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.jetbrains.python.console;
-
-import com.intellij.execution.ui.ConsoleViewContentType;
-import com.intellij.openapi.extensions.ExtensionPointName;
-import org.jetbrains.annotations.NotNull;
-
-public interface PyConsoleOutputFilter {
- ExtensionPointName<PyConsoleOutputFilter> EP_NAME = ExtensionPointName.create("Pythonid.pyConsoleOutputFilter");
-
- boolean reject(@NotNull String text, @NotNull final ConsoleViewContentType outputType);
-}
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
-import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.Task;
@Override
public void print(@NotNull String text, @NotNull final ConsoleViewContentType outputType) {
- for (PyConsoleOutputFilter filter : Extensions.getExtensions(PyConsoleOutputFilter.EP_NAME)) {
- if (filter.reject(text, outputType)) {
- return;
- }
- }
-
detectIPython(text, outputType);
if (PyConsoleUtil.detectIPythonEnd(text)) {
myIsIPythonOutput = false;
}
}
+ public void addTemporaryBreakpoint(String typeId, String file, int line) {
+ if (isConnected()) {
+ myDebugger.setTempBreakpoint(typeId, file, line);
+ }
+ }
+
public void removeBreakpoint(final PySourcePosition position) {
XLineBreakpoint breakpoint = myRegisteredBreakpoints.get(position);
if (breakpoint != null) {
final List<PyStackFrameInfo> frames = threadInfo.getFrames();
if (frames != null) {
- final PySuspendContext suspendContext = new PySuspendContext(this, threadInfo);
+ final PySuspendContext suspendContext = createSuspendContext(threadInfo);
XBreakpoint<?> breakpoint = null;
if (threadInfo.isStopOnBreakpoint()) {
}
}
+ @NotNull
+ protected PySuspendContext createSuspendContext(PyThreadInfo threadInfo) {
+ return new PySuspendContext(this, threadInfo);
+ }
+
@Override
public void threadResumed(final PyThreadInfo threadInfo) {
mySuspendedThreads.remove(threadInfo);
import com.jetbrains.python.run.AbstractPythonRunConfiguration;
import com.jetbrains.python.run.CommandLinePatcher;
import com.jetbrains.python.run.PythonCommandLineState;
-import com.jetbrains.python.run.PythonRunConfiguration;
import com.jetbrains.python.sdk.flavors.PythonSdkFlavor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
createDebugProcess(session, serverSocket, result, pyState);
createConsoleCommunicationAndSetupActions(environment.getProject(), result, pyDebugProcess, session);
- initDebugProcess(((PythonRunConfiguration)environment.getRunProfile()).getScriptName(), pyDebugProcess);
return pyDebugProcess;
}
});
pyState.isMultiprocessDebug());
}
- protected void initDebugProcess(String name, PyDebugProcess pyDebugProcess) {
- }
-
@Override
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull final ExecutionEnvironment environment) throws ExecutionException {
XDebugSession session = createSession(state, environment);
import org.jetbrains.annotations.NotNull;
public interface PyDebugValueTransformer {
- ExtensionPointName<PyDebugValueTransformer> EP_NAME = ExtensionPointName.create("Pythonid.pyDebugValueTransformer");
+ ExtensionPointName<PyDebugValueTransformer> EP_NAME = ExtensionPointName.create("Pythonid.debugValueTransformer");
/**
* This method is used in python debugger to modify content and presentation of stack frame nodes