Add Line/Column to XPath Output

This commit is contained in:
Josh Johnson 2016-01-07 11:06:08 -05:00
parent a72830b762
commit 3d916fc9b4

View File

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