зеркало из https://github.com/mozilla/brackets.git
Add HTMLInstrumentation._dumpMarks back
This commit is contained in:
Родитель
55e6a28f74
Коммит
d58bad1b69
|
@ -42,7 +42,7 @@
|
|||
|
||||
"browser" : false,
|
||||
"couch" : false,
|
||||
"devel" : false,
|
||||
"devel" : true,
|
||||
"dojo" : false,
|
||||
"jquery" : false,
|
||||
"mootools" : false,
|
||||
|
|
|
@ -162,6 +162,26 @@ define(function (require, exports, module) {
|
|||
return match.mark;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Dumps the current list of mark ranges for instrumented tags to the console. Used for debugging.
|
||||
* @param {Editor} editor The editor to find the mark ranges for.
|
||||
* @param {Object=} nodeMap If specified, a map of tag IDs to DOM nodes, used so we can indicate which tag name
|
||||
* the DOM thinks corresponds to the given mark.
|
||||
*/
|
||||
function _dumpMarks(editor, nodeMap) {
|
||||
var markCache = {},
|
||||
marks = _getSortedTagMarks(editor._codeMirror.getAllMarks(), markCache);
|
||||
marks.forEach(function (markInfo) {
|
||||
var mark = markInfo.mark,
|
||||
range = markInfo.range;
|
||||
console.log("<" + nodeMap[mark.tagID].tag + "> (" + mark.tagID + ") " +
|
||||
range.from.line + ":" + range.from.ch + " - " + range.to.line + ":" + range.to.ch);
|
||||
});
|
||||
}
|
||||
// Workaround for JSHint to not complain about the unused function
|
||||
void(_dumpMarks);
|
||||
|
||||
/**
|
||||
* Get the instrumented tagID at the specified position. Returns -1 if
|
||||
* there are no instrumented tags at the location.
|
||||
|
|
Загрузка…
Ссылка в новой задаче