Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ private Types.StackFrame convertDebuggerStackFrameToClient(StackFrame stackFrame
String methodName = formatMethodName(method, true, true);
int lineNumber = AdapterUtils.convertLineNumber(location.lineNumber(), context.isDebuggerLinesStartAt1(), context.isClientLinesStartAt1());
// Line number returns -1 if the information is not available; specifically, always returns -1 for native methods.
String presentationHint = null;
if (lineNumber < 0) {
presentationHint = "subtle";
if (method.isNative()) {
// For native method, display a tip text "native method" in the Call Stack View.
methodName += "[native method]";
Expand All @@ -105,7 +107,7 @@ private Types.StackFrame convertDebuggerStackFrameToClient(StackFrame stackFrame
clientSource = null;
}
}
return new Types.StackFrame(frameId, methodName, clientSource, lineNumber, context.isClientColumnsStartAt1() ? 1 : 0);
return new Types.StackFrame(frameId, methodName, clientSource, lineNumber, context.isClientColumnsStartAt1() ? 1 : 0, presentationHint);
}

private Types.Source convertDebuggerSourceToClient(Location location, IDebugAdapterContext context) throws URISyntaxException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public static class StackFrame {
public int line;
public int column;
public String name;
public String presentationHint;


/**
* Constructs a StackFrame with the given information.
Expand All @@ -57,13 +59,17 @@ public static class StackFrame {
* line number of the stack frame
* @param col
* column number of the stack frame
* @param presentationHint
* An optional hint for how to present this frame in the UI.
* Values: 'normal', 'label', 'subtle'
*/
public StackFrame(int id, String name, Source src, int ln, int col) {
public StackFrame(int id, String name, Source src, int ln, int col, String presentationHint) {
this.id = id;
this.name = name;
this.source = src;
this.line = ln;
this.column = col;
this.presentationHint = presentationHint;
}
}

Expand Down