Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1605)

Unified Diff: Source/devtools/front_end/sources/SourcesPanel.js

Issue 1361863002: Devtools: API To set the red/yellow squiggles for a file via DI (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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}

Powered by Google App Engine
This is Rietveld 408576698