forked from external/vscode-xml
		
	Mock xmldom Node Implementation
This commit is contained in:
		
							parent
							
								
									a263b85003
								
							
						
					
					
						commit
						f77bc88576
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -65,9 +65,7 @@ export class XPathFeatureProvider {
 | 
			
		|||
            outputChannel.appendLine(`XPath Query: ${query}`);
 | 
			
		||||
            outputChannel.append('\n');
 | 
			
		||||
            
 | 
			
		||||
            // 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: XmlNode) => {
 | 
			
		||||
                outputChannel.appendLine(`[Line ${node.lineNumber}] ${node.localName}: ${node.textContent}`);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								typings/xmldom/xmldom.d.ts
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								typings/xmldom/xmldom.d.ts
									
										
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
declare class XmlNode extends Node {
 | 
			
		||||
    lineNumber: number;
 | 
			
		||||
    columnNumber: number;
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		
		Reference in a new issue