import * as vscode from 'vscode' ; import { TestNode } from '../testExplorer/testNode' ; param index function updateSelection ( index ) { const editor = vscode . window . activeTextEditor ; if ( editor ) { if ( index instanceof vscode . Range ) { editor . selection = new vscode . Selection ( index . start , index . end ) ; editor . revealRange ( index ) ; } else { const line = editor . document . lineAt ( index ) ; const startPos = new vscode . Position ( line . lineNumber , line . firstNonWhitespaceCharacterIndex ) ; editor . selection = new vscode . Selection ( startPos , line . range . end ) ; editor . revealRange ( line . range ) ; } } } param node export function forceLwcTestNavigateToTest ( node ) { if ( node . location ) { vscode . window . showTextDocument ( node . location . uri ) ; } const position = node . location ! . range ; updateSelection ( position ) ; }