Mock xmldom Node Implementation

This commit is contained in:
Josh Johnson 2016-01-13 18:01:17 -05:00
parent a263b85003
commit f77bc88576
2 changed files with 5 additions and 3 deletions

View File

@ -65,9 +65,7 @@ export class XPathFeatureProvider {
outputChannel.appendLine(`XPath Query: ${query}`); outputChannel.appendLine(`XPath Query: ${query}`);
outputChannel.append('\n'); outputChannel.append('\n');
// node.lineNumber and node.columnNumber are not standard properties of the Node object (implemented by xmldom) nodes.forEach((node: XmlNode) => {
// TypeScript will complain, but should still compile. this is preferable right now over mocking the entire typedef
nodes.forEach((node: Node) => {
outputChannel.appendLine(`[Line ${node.lineNumber}] ${node.localName}: ${node.textContent}`); outputChannel.appendLine(`[Line ${node.lineNumber}] ${node.localName}: ${node.textContent}`);
}); });

4
typings/xmldom/xmldom.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
declare class XmlNode extends Node {
lineNumber: number;
columnNumber: number;
}