Index: Source/devtools/front_end/sources/SourcesPanel.js |
diff --git a/Source/devtools/front_end/sources/SourcesPanel.js b/Source/devtools/front_end/sources/SourcesPanel.js |
index 380b268dce587311ab8275671ba59d8aee46765e..c256bffed431653f711065d14d0069f314b75233 100644 |
--- a/Source/devtools/front_end/sources/SourcesPanel.js |
+++ b/Source/devtools/front_end/sources/SourcesPanel.js |
@@ -1356,6 +1356,44 @@ WebInspector.SourcesPanel.DebuggerPausedDetailsRevealer.prototype = { |
} |
} |
+ |
+/** |
+ * @constructor |
+ * @implements {WebInspector.Revealer} |
+ */ |
+WebInspector.SourcesPanel.LineMessageRevealer = function() |
+{ |
+} |
+ |
+WebInspector.SourcesPanel.LineMessageRevealer.prototype = { |
+ /** |
+ * @override |
+ * @param {!Object} object |
+ * @return {!Promise} |
+ */ |
+ reveal: function(object) |
+ { |
+ var container = /** @type {!WebInspector.UISourceCodeMessages} */ (object); |
+ if (!(container.messages() instanceof Array)) |
pfeldman
2015/10/21 23:47:53
There is a compile-time check for this.
wes
2015/10/23 20:35:30
How so? container is cast from Object to the data
|
+ return Promise.reject(new Error("Internal error: messages member not an array of line message definition objects")); |
+ if (!(container.source() instanceof WebInspector.UISourceCode)) |
+ return Promise.reject(new Error("Internal error: code member not a UISourceCode objects")); |
+ |
+ var frame = WebInspector.SourcesPanel.instance().sourcesView().viewForFile(container.source()); |
+ frame.setMessagesForSource(container.messages().map(function(m){ |
pfeldman
2015/10/21 23:47:53
Revealers are for revealing things, not for popula
wes
2015/10/23 04:51:01
I'd actually wavered on if squiggles should be sta
|
+ return new WebInspector.SourceFrameMessage(m.text(), WebInspector.SourceFrameMessage.Level[m.kind()], { |
+ line: m.location().startLine, |
+ column: m.location().startColumn |
+ }, { |
+ line: m.location().endLine, |
+ column: m.location().endColumn |
+ }); |
+ })); |
+ |
+ return Promise.resolve(); |
+ } |
+} |
+ |
/** |
* @constructor |
* @implements {WebInspector.ActionDelegate} |