summaryrefslogtreecommitdiff
path: root/platform/script-debugger
diff options
context:
space:
mode:
Diffstat (limited to 'platform/script-debugger')
-rw-r--r--platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/BasicDebuggerViewSupport.java5
-rw-r--r--platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.java2
-rw-r--r--platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.java2
-rw-r--r--platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java10
-rw-r--r--platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/StackFrameImplBase.java15
5 files changed, 29 insertions, 5 deletions
diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/BasicDebuggerViewSupport.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/BasicDebuggerViewSupport.java
index 53fa54a3e9c3..a5cf778db7e2 100644
--- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/BasicDebuggerViewSupport.java
+++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/BasicDebuggerViewSupport.java
@@ -106,4 +106,9 @@ public class BasicDebuggerViewSupport implements DebuggerViewSupport, MemberFilt
public Value transformErrorOnGetUsedReferenceValue(@Nullable Value value, @Nullable String error) {
return value;
}
+
+ @Override
+ public boolean isInLibraryContent(@NotNull SourceInfo sourceInfo, @Nullable Script script) {
+ return false;
+ }
} \ No newline at end of file
diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.java
index cf24d062cada..d341dda0bec1 100644
--- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.java
+++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.java
@@ -56,4 +56,6 @@ public interface DebuggerViewSupport {
@Nullable
Value transformErrorOnGetUsedReferenceValue(@Nullable Value value, @Nullable String error);
+
+ boolean isInLibraryContent(@NotNull SourceInfo sourceInfo, @Nullable Script script);
} \ No newline at end of file
diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.java
index 352b67351f63..ada850da074b 100644
--- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.java
+++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.java
@@ -164,7 +164,7 @@ public final class VariableView extends XNamedValue implements VariableContext {
if (!node.isObsolete()) {
value = getViewSupport().transformErrorOnGetUsedReferenceValue(value, error);
if (value == null) {
- node.setPresentation(getIcon(), null, error, false);
+ node.setPresentation(AllIcons.Debugger.Db_primitive, null, error, false);
}
else {
VariableView.this.value = value;
diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java
index eb698e685403..3cb993a01194 100644
--- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java
+++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java
@@ -16,6 +16,8 @@ public final class CallFrameView extends StackFrameImplBase implements VariableC
private final Script script;
+ private final boolean inLibraryContent;
+
public CallFrameView(@NotNull CallFrame callFrame, @NotNull DebuggerViewSupport debugProcess, @Nullable Script script) {
this(callFrame, debugProcess.getSourceInfo(script, callFrame), debugProcess, script);
}
@@ -29,6 +31,9 @@ public final class CallFrameView extends StackFrameImplBase implements VariableC
this.debugProcess = debugProcess;
this.callFrame = callFrame;
this.script = script;
+
+ // isInLibraryContent call could be costly, so we compute it only once (our customizePresentation called on each repaint)
+ inLibraryContent = sourceInfo != null && debugProcess.isInLibraryContent(sourceInfo, script);
}
@Override
@@ -48,6 +53,11 @@ public final class CallFrameView extends StackFrameImplBase implements VariableC
}
@Override
+ protected boolean isInLibraryContent() {
+ return inLibraryContent;
+ }
+
+ @Override
protected void customizeInvalidFramePresentation(ColoredTextContainer component) {
assert sourceInfo == null;
diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/StackFrameImplBase.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/StackFrameImplBase.java
index adc67ba57ba8..fb4e8771a48b 100644
--- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/StackFrameImplBase.java
+++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/StackFrameImplBase.java
@@ -38,6 +38,10 @@ public abstract class StackFrameImplBase extends XStackFrame {
return false;
}
+ protected boolean isInLibraryContent() {
+ return false;
+ }
+
@Override
public final void customizePresentation(@NotNull ColoredTextContainer component) {
if (sourceInfo == null) {
@@ -48,18 +52,21 @@ public abstract class StackFrameImplBase extends XStackFrame {
String fileName = sourceInfo.getFile().getName();
int line = sourceInfo.getLine() + 1;
+ boolean isInLibraryContent = isInLibraryContent();
+ SimpleTextAttributes textAttributes = isInLibraryContent ? SimpleTextAttributes.GRAYED_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES;
+
String functionName = sourceInfo.getFunctionName();
if (functionName == null || (functionName.isEmpty() && isInFileScope())) {
- component.append(fileName + ":" + line, SimpleTextAttributes.REGULAR_ATTRIBUTES);
+ component.append(fileName + ":" + line, textAttributes);
}
else {
if (functionName.isEmpty()) {
- component.append("anonymous", SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES);
+ component.append("anonymous", isInLibraryContent ? SimpleTextAttributes.GRAYED_ITALIC_ATTRIBUTES : SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES);
}
else {
- component.append(functionName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
+ component.append(functionName, textAttributes);
}
- component.append("(), " + fileName + ":" + line, SimpleTextAttributes.REGULAR_ATTRIBUTES);
+ component.append("(), " + fileName + ":" + line, textAttributes);
}
component.setIcon(AllIcons.Debugger.StackFrame);
}