本文整理了Java中com.intellij.xdebugger.breakpoints.XLineBreakpoint
类的一些代码示例,展示了XLineBreakpoint
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XLineBreakpoint
类的具体详情如下:
包路径:com.intellij.xdebugger.breakpoints.XLineBreakpoint
类名称:XLineBreakpoint
暂无
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Override
public void unregisterBreakpoint(@NotNull XLineBreakpoint<DlvBreakpointProperties> breakpoint, boolean temporary) {
XSourcePosition breakpointPosition = breakpoint.getSourcePosition();
if (breakpointPosition == null) return;
Integer id = breakpoint.getUserData(ID);
if (id == null) return; // obsolete
breakpoint.putUserData(ID, null);
breakpoints.remove(id);
send(new DlvRequest.ClearBreakpoint(id));
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Override
public void registerBreakpoint(@NotNull XLineBreakpoint<DlvBreakpointProperties> breakpoint) {
XSourcePosition breakpointPosition = breakpoint.getSourcePosition();
if (breakpointPosition == null) return;
VirtualFile file = breakpointPosition.getFile();
int line = breakpointPosition.getLine();
send(new DlvRequest.CreateBreakpoint(file.getPath(), line + 1))
.done(b -> {
breakpoint.putUserData(ID, b.id);
breakpoints.put(b.id, breakpoint);
getSession().updateBreakpointPresentation(breakpoint, AllIcons.Debugger.Db_verified_breakpoint, null);
})
.rejected(t -> {
String message = t == null ? null : t.getMessage();
getSession().updateBreakpointPresentation(breakpoint, AllIcons.Debugger.Db_invalid_breakpoint, message);
});
}
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
public void registerBreakpoint(
@NotNull final XLineBreakpoint<CloudLineBreakpointProperties> ideBreakpoint) {
if (ideBreakpoint.getSourcePosition() == null
|| !ideBreakpoint.isEnabled()
|| !(ideBreakpoint.getType() instanceof CloudLineBreakpointType)) {
return;
if (ideBreakpoint.getProperties().isCreatedByServer()) {
if (ideBreakpoint.getProperties().isAddedOnServer()
&& !ideBreakpoint.getProperties().isDisabledByServer()) {
PsiFile psiFile = psiManager.findFile(ideBreakpoint.getSourcePosition().getFile());
location.setLine(ideBreakpoint.getSourcePosition().getLine() + 1);
if (ideBreakpoint.getConditionExpression() != null) {
serverNewBreakpoint.setCondition(ideBreakpoint.getConditionExpression().getExpression());
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
when(virtualFile.getUrl()).thenReturn(MOCK_FILE_URL);
when(xLineBreakpoint.getUserData(com.intellij.debugger.ui.breakpoints.Breakpoint.DATA_KEY))
.thenReturn(cloudLineBreakpoint);
when(xLineBreakpoint.getProperties()).thenReturn(cloudLineBreakpointProperties);
.addLineBreakpoint(any(), eq(MOCK_FILE_URL), eq(line), eq(cloudLineBreakpointProperties));
verify(xLineBreakpoint).putUserData(keyArgumentCaptor.capture(), eq("mock-breakpoint-id"));
assertThat(keyArgumentCaptor.getValue().toString())
.isEqualTo("CloudId"); // CloudBreakpointHandler.CLOUD_ID
verify(xLineBreakpoint).setCondition(eq(MOCK_BREAKPOINT_CONDITION));
代码示例来源:origin: ballerina-platform/ballerina-lang
@Override
public void unregisterBreakpoint(@NotNull XLineBreakpoint<BallerinaBreakpointProperties> breakpoint,
boolean temporary) {
XSourcePosition breakpointPosition = breakpoint.getSourcePosition();
if (breakpointPosition == null) {
return;
}
breakpoints.remove(breakpoint);
sendBreakpoints();
}
代码示例来源:origin: Camelcade/Perl5-IDEA
@Nullable
public static PerlLineBreakPointDescriptor createFromBreakpoint(XLineBreakpoint<PerlLineBreakpointProperties> breakpoint,
PerlDebugThread debugThread) {
String fileUrl = breakpoint.getFileUrl();
descriptor.line = breakpoint.getLine();
descriptor.enabled = breakpoint.isEnabled();
descriptor.remove = false;
XExpression logExpressionObject = breakpoint.getLogExpressionObject();
if (logExpressionObject != null) {
descriptor.action = logExpressionObject.getExpression();
SuspendPolicy suspendPolicy = breakpoint.getSuspendPolicy();
descriptor.suspend = suspendPolicy != SuspendPolicy.NONE;
XExpression conditionExpression = breakpoint.getConditionExpression();
descriptor.condition = conditionExpression != null ? conditionExpression.getExpression() : "";
return descriptor;
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
CloudLineBreakpointType.getInstance(), file.getUrl(), line, properties);
newXIdeBreakpoint.putUserData(CloudBreakpointHandler.CLOUD_ID, serverBreakpoint.getId());
ideBreakpoints.put(serverBreakpoint.getId(), newXIdeBreakpoint);
newXIdeBreakpoint.setCondition(serverBreakpoint.getCondition());
.getProperties()
.setWatchExpressions(
serverBreakpoint
newXIdeBreakpoint.getProperties().setCreatedByServer(false);
com.intellij.debugger.ui.breakpoints.Breakpoint cloudIdeBreakpoint =
BreakpointManager.getJavaBreakpoint(newXIdeBreakpoint);
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
debuggerEditorsProvider,
this,
breakpoint.getSourcePosition(),
"GoogleCloudTools.BreakpointWatchContextMenu",
null);
List<XExpression> watches = new ArrayList<XExpression>();
for (String watchExpression : breakpoint.getProperties().getWatchExpressions()) {
watches.add(
debuggerEditorsProvider.createExpression(
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
@Override
public void unregisterBreakpoint(
@NotNull XLineBreakpoint<CloudLineBreakpointProperties> ideBreakpoint, boolean temporary) {
// If the state was set to disabled as a result of a server update,
// then we do not need to update the server side.
if (!ideBreakpoint.getProperties().isDisabledByServer()) {
String breakpointId = ideBreakpoint.getUserData(CLOUD_ID);
if (!Strings.isNullOrEmpty(breakpointId)) {
process.getStateController().deleteBreakpointAsync(breakpointId);
} else {
LOG.warn("could not delete breakpoint because it was not added through the cloud handler.");
}
}
// reset this flag: either it has been disabled by the server or the client has deleted it, in
// both cases we need to add it again, if it is re-enabled
ideBreakpoint.getProperties().setAddedOnServer(false);
}
}
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
@SuppressWarnings("ConstantConditions")
@Override
public void saveTo(@NotNull final XLineBreakpoint<CloudLineBreakpointProperties> ideBreakpoint) {
CloudLineBreakpointProperties properties = ideBreakpoint.getProperties();
if (properties == null) {
LOG.error(
"Could not save changes to the breakpoint because for some reason it does not have cloud "
+ "properties.");
return;
}
XBreakpointBase lineBreakpointImpl =
ideBreakpoint instanceof XBreakpointBase ? (XBreakpointBase) ideBreakpoint : null;
if (rootNode != null && lineBreakpointImpl != null) {
List<String> expressionsToSave = new ArrayList<String>();
List<? extends WatchNode> children = rootNode.getAllChildren();
if (children != null) {
for (WatchNode node : rootNode.getAllChildren()) {
expressionsToSave.add(node.getExpression().getExpression());
}
if (properties.setWatchExpressions(
expressionsToSave.toArray(new String[expressionsToSave.size()]))) {
lineBreakpointImpl.fireBreakpointChanged();
}
}
}
}
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
@Override
public void run() {
if (finalserverBreakpoint.getExpressions() != null
&& finalserverBreakpoint.getExpressions().size() > 0) {
properties.setWatchExpressions(
finalserverBreakpoint
.getExpressions()
.toArray(new String[finalserverBreakpoint.getExpressions().size()]));
}
XLineBreakpoint<CloudLineBreakpointProperties> newxIdeBreakpoint =
manager.addLineBreakpoint(
CloudLineBreakpointType.getInstance(), file.getUrl(), line, properties);
// Condition, watches.
if (!Strings.isNullOrEmpty(finalserverBreakpoint.getCondition())) {
newxIdeBreakpoint.setCondition(finalserverBreakpoint.getCondition());
}
}
});
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
if (existingXIdeBreakpoint != null && existingXIdeBreakpoint.isEnabled()) {
continue;
代码示例来源:origin: ballerina-platform/ballerina-lang
@Override
public void registerBreakpoint(@NotNull XLineBreakpoint<BallerinaBreakpointProperties> breakpoint) {
XSourcePosition breakpointPosition = breakpoint.getSourcePosition();
if (breakpointPosition == null) {
return;
}
breakpoints.add(breakpoint);
sendBreakpoints();
getSession().updateBreakpointPresentation(breakpoint, AllIcons.Debugger.Db_verified_breakpoint, null);
}
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
isA(CloudLineBreakpointProperties.class)))
.thenReturn(mockLineBreakpoint);
when(mockLineBreakpoint.getProperties()).thenReturn(new CloudLineBreakpointProperties());
VirtualFile projectDir = mock(VirtualFile.class);
when(projectDir.getPath()).thenReturn("/project/dir");
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
@Nullable
private static Language getFileTypeLanguage(
XLineBreakpoint<CloudLineBreakpointProperties> breakpoint) {
if (breakpoint.getSourcePosition() != null) {
FileType fileType = breakpoint.getSourcePosition().getFile().getFileType();
if (fileType instanceof LanguageFileType) {
return ((LanguageFileType) fileType).getLanguage();
}
}
return null;
}
代码示例来源:origin: intellij-dlanguage/intellij-dlanguage
} else {
XSourcePosition sourcePosition = breakpoint.getSourcePosition();
if (sourcePosition == null) {
return;
内容来源于网络,如有侵权,请联系作者删除!