From 3d916fc9b4fa5bd8147ba476445f6dede89100b3 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Thu, 7 Jan 2016 11:06:08 -0500 Subject: [PATCH] Add Line/Column to XPath Output --- src/providers/XPath.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/providers/XPath.ts b/src/providers/XPath.ts index 6a7a4d1..c8babb4 100644 --- a/src/providers/XPath.ts +++ b/src/providers/XPath.ts @@ -65,8 +65,10 @@ export class XPathFeatureProvider { outputChannel.appendLine(`XPath Query: ${query}`); 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) => { - outputChannel.appendLine(`${node.localName}: ${node.textContent}`); + outputChannel.appendLine(`[${node.lineNumber}, ${node.columnNumber}] ${node.localName}: ${node.textContent}`); }); outputChannel.show(vsc.ViewColumn.Three);