mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<component>
|
||||
<version codename="Community Edition" major="13" minor="1" eap="true"/>
|
||||
<version codename="Community Edition" major="14" minor="0" eap="true"/>
|
||||
<company name="JetBrains s.r.o." url="http://www.jetbrains.com/?fromIDE"/>
|
||||
<build number="__BUILD_NUMBER__" date="__BUILD_DATE__"/>
|
||||
<install-over minbuild="129.1" maxbuild="135.9999" version="13.1"/>
|
||||
|
||||
+3
-3
@@ -20,9 +20,9 @@ import com.intellij.execution.ExecutionException;
|
||||
/**
|
||||
* @author michael.golubev
|
||||
*/
|
||||
public interface JavaDebugServerModeHandler {
|
||||
public abstract class JavaDebugServerModeHandler {
|
||||
|
||||
void attachRemote() throws ExecutionException;
|
||||
public abstract void attachRemote() throws ExecutionException;
|
||||
|
||||
void detachRemote() throws ExecutionException;
|
||||
public abstract void detachRemote() throws ExecutionException;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public abstract class XDebuggerUtil {
|
||||
toggleLineBreakpoint(project, file, line, false);
|
||||
}
|
||||
|
||||
public abstract XLineBreakpoint toggleLineBreakpoint(@NotNull Project project,
|
||||
public abstract void toggleLineBreakpoint(@NotNull Project project,
|
||||
@NotNull VirtualFile file,
|
||||
int line,
|
||||
boolean temporary);
|
||||
@@ -59,7 +59,7 @@ public abstract class XDebuggerUtil {
|
||||
toggleLineBreakpoint(project, type, file, line, false);
|
||||
}
|
||||
|
||||
public abstract <P extends XBreakpointProperties> XLineBreakpoint toggleLineBreakpoint(@NotNull Project project,
|
||||
public abstract <P extends XBreakpointProperties> void toggleLineBreakpoint(@NotNull Project project,
|
||||
@NotNull XLineBreakpointType<P> type,
|
||||
@NotNull VirtualFile file,
|
||||
int line,
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
@@ -75,7 +74,7 @@ public class XDebuggerUtilImpl extends XDebuggerUtil {
|
||||
}
|
||||
|
||||
@Override
|
||||
public XLineBreakpoint toggleLineBreakpoint(@NotNull final Project project, @NotNull final VirtualFile file, final int line, boolean temporary) {
|
||||
public void toggleLineBreakpoint(@NotNull final Project project, @NotNull final VirtualFile file, final int line, boolean temporary) {
|
||||
XLineBreakpointType<?> typeWinner = null;
|
||||
for (XLineBreakpointType<?> type : getLineBreakpointTypes()) {
|
||||
if (type.canPutAt(file, line, project) && (typeWinner == null || type.getPriority() > typeWinner.getPriority())) {
|
||||
@@ -83,9 +82,8 @@ public class XDebuggerUtilImpl extends XDebuggerUtil {
|
||||
}
|
||||
}
|
||||
if (typeWinner != null) {
|
||||
return toggleLineBreakpoint(project, typeWinner, file, line, temporary);
|
||||
toggleLineBreakpoint(project, typeWinner, file, line, temporary);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,15 +97,22 @@ public class XDebuggerUtilImpl extends XDebuggerUtil {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <P extends XBreakpointProperties> XLineBreakpoint toggleLineBreakpoint(@NotNull final Project project,
|
||||
public <P extends XBreakpointProperties> void toggleLineBreakpoint(@NotNull final Project project,
|
||||
@NotNull final XLineBreakpointType<P> type,
|
||||
@NotNull final VirtualFile file,
|
||||
final int line,
|
||||
final boolean temporary) {
|
||||
final Ref<XLineBreakpoint> res = new Ref<XLineBreakpoint>();
|
||||
new WriteAction() {
|
||||
toggleAndReturnLineBreakpoint(project, type, file, line, temporary);
|
||||
}
|
||||
|
||||
public static <P extends XBreakpointProperties> XLineBreakpoint toggleAndReturnLineBreakpoint(@NotNull final Project project,
|
||||
@NotNull final XLineBreakpointType<P> type,
|
||||
@NotNull final VirtualFile file,
|
||||
final int line,
|
||||
final boolean temporary) {
|
||||
return new WriteAction<XLineBreakpoint>() {
|
||||
@Override
|
||||
protected void run(@NotNull final Result result) {
|
||||
protected void run(@NotNull final Result<XLineBreakpoint> result) {
|
||||
XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager();
|
||||
XLineBreakpoint<P> breakpoint = breakpointManager.findBreakpointAtLine(type, file, line);
|
||||
if (breakpoint != null) {
|
||||
@@ -115,11 +120,10 @@ public class XDebuggerUtilImpl extends XDebuggerUtil {
|
||||
}
|
||||
else {
|
||||
P properties = type.createBreakpointProperties(file, line);
|
||||
res.set(breakpointManager.addLineBreakpoint(type, file.getUrl(), line, properties, temporary));
|
||||
result.setResult(breakpointManager.addLineBreakpoint(type, file.getUrl(), line, properties, temporary));
|
||||
}
|
||||
}
|
||||
}.execute();
|
||||
return res.get();
|
||||
}.execute().getResultObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+10
-10
@@ -28,6 +28,7 @@ import com.intellij.xdebugger.XDebuggerManager;
|
||||
import com.intellij.xdebugger.XDebuggerUtil;
|
||||
import com.intellij.xdebugger.breakpoints.*;
|
||||
import com.intellij.xdebugger.impl.DebuggerSupport;
|
||||
import com.intellij.xdebugger.impl.XDebuggerUtilImpl;
|
||||
import com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem;
|
||||
import com.intellij.xdebugger.impl.breakpoints.ui.BreakpointPanelProvider;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -167,20 +168,19 @@ public class XBreakpointUtil {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XLineBreakpoint res = null;
|
||||
if (typeWinner != null) {
|
||||
res = XDebuggerUtil.getInstance().toggleLineBreakpoint(project, typeWinner, file, lineWinner, temporary);
|
||||
}
|
||||
XLineBreakpoint res = XDebuggerUtilImpl.toggleAndReturnLineBreakpoint(project, typeWinner, file, lineWinner, temporary);
|
||||
|
||||
if (editor != null && lineStart != lineWinner) {
|
||||
int offset = editor.getDocument().getLineStartOffset(lineWinner);
|
||||
ExpandRegionAction.expandRegionAtOffset(project, editor, offset);
|
||||
if (moveCarret) {
|
||||
editor.getCaretModel().moveToOffset(offset);
|
||||
if (editor != null && lineStart != lineWinner) {
|
||||
int offset = editor.getDocument().getLineStartOffset(lineWinner);
|
||||
ExpandRegionAction.expandRegionAtOffset(project, editor, offset);
|
||||
if (moveCarret) {
|
||||
editor.getCaretModel().moveToOffset(offset);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
return res;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user