| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @implements {WebInspector.SourceMap} | 7 * @implements {WebInspector.SourceMap} |
| 8 * @param {string} compiledURL | 8 * @param {string} compiledURL |
| 9 * @param {string} sourceMapURL | 9 * @param {string} sourceMapURL |
| 10 * @param {!Map<string, !WebInspector.SASSSupport.AST>} models | 10 * @param {!Map<string, !WebInspector.SASSSupport.AST>} models |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 */ | 59 */ |
| 60 sourceContentProvider: function(sourceURL, contentType) | 60 sourceContentProvider: function(sourceURL, contentType) |
| 61 { | 61 { |
| 62 var model = this.modelForURL(sourceURL); | 62 var model = this.modelForURL(sourceURL); |
| 63 var sourceContent = model ? model.document.text.value() : ""; | 63 var sourceContent = model ? model.document.text.value() : ""; |
| 64 return WebInspector.StaticContentProvider.fromString(sourceURL, contentT
ype, sourceContent); | 64 return WebInspector.StaticContentProvider.fromString(sourceURL, contentT
ype, sourceContent); |
| 65 }, | 65 }, |
| 66 | 66 |
| 67 /** | 67 /** |
| 68 * @override | 68 * @override |
| 69 * @param {string} sourceURL |
| 70 * @return {?string} |
| 71 */ |
| 72 embeddedContentByURL: function(sourceURL) |
| 73 { |
| 74 var model = this.modelForURL(sourceURL); |
| 75 return model ? model.document.text.value() : ""; |
| 76 }, |
| 77 |
| 78 /** |
| 79 * @override |
| 69 * @param {number} lineNumber | 80 * @param {number} lineNumber |
| 70 * @param {number=} columnNumber | 81 * @param {number=} columnNumber |
| 71 * @return {?WebInspector.SourceMapEntry} | 82 * @return {?WebInspector.SourceMapEntry} |
| 72 */ | 83 */ |
| 73 findEntry: function(lineNumber, columnNumber) | 84 findEntry: function(lineNumber, columnNumber) |
| 74 { | 85 { |
| 75 columnNumber = columnNumber || 0; | 86 columnNumber = columnNumber || 0; |
| 76 var compiledNode = this.compiledModel().findNodeForPosition(lineNumber,
columnNumber); | 87 var compiledNode = this.compiledModel().findNodeForPosition(lineNumber,
columnNumber); |
| 77 if (!compiledNode) | 88 if (!compiledNode) |
| 78 return null; | 89 return null; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 for (var i = 0; i < compiledNodes.length; ++i) { | 210 for (var i = 0; i < compiledNodes.length; ++i) { |
| 200 var compiledNode = compiledNodes[i]; | 211 var compiledNode = compiledNodes[i]; |
| 201 var sourceNode = /** @type {!WebInspector.SASSSupport.TextNode} */(t
his._compiledToSource.get(compiledNode)); | 212 var sourceNode = /** @type {!WebInspector.SASSSupport.TextNode} */(t
his._compiledToSource.get(compiledNode)); |
| 202 var mappedCompiledNode = /** @type {!WebInspector.SASSSupport.TextNo
de} */(outNodeMapping.get(compiledNode) || compiledNode); | 213 var mappedCompiledNode = /** @type {!WebInspector.SASSSupport.TextNo
de} */(outNodeMapping.get(compiledNode) || compiledNode); |
| 203 var mappedSourceNode = /** @type {!WebInspector.SASSSupport.TextNode
} */(outNodeMapping.get(sourceNode) || sourceNode); | 214 var mappedSourceNode = /** @type {!WebInspector.SASSSupport.TextNode
} */(outNodeMapping.get(sourceNode) || sourceNode); |
| 204 newMap.addMapping(mappedCompiledNode, mappedSourceNode); | 215 newMap.addMapping(mappedCompiledNode, mappedSourceNode); |
| 205 } | 216 } |
| 206 return newMap; | 217 return newMap; |
| 207 } | 218 } |
| 208 } | 219 } |
| OLD | NEW |