File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,13 +4,12 @@ import assert from 'assert';
44
55
66suite ( 'hover values' , ( ) => {
7- let editor : vscode . TextEditor ;
87 suiteSetup ( async ( ) => {
98 await activateExtension ( ) ;
10- editor = await openTestFile ( 'hover-values-example.R' ) ;
119 } ) ;
1210
1311 const tc = async ( pos : vscode . Position , expected : string ) => {
12+ const editor = await openTestFile ( 'hover-values-example.R' ) ;
1413 const result : vscode . Hover [ ] = await vscode . commands . executeCommand ( 'vscode.executeHoverProvider' , editor . document . uri , pos ) ;
1514 assert . ok ( result , 'failed to get result' ) ;
1615 assert . equal ( result . length , 1 , `expected 1 result but got ${ result . length } ` ) ;
Original file line number Diff line number Diff line change @@ -7,21 +7,23 @@ import type { FlowrInternalSession } from '../flowr/internal-session';
77import type { FlowrExtensionApi } from '../extension' ;
88
99/**
10- * Activate the extension and return its {@link FlowrExtensionApi}
10+ * Activate the extension (if not already active) and return its {@link FlowrExtensionApi}
1111 */
1212export async function activateExtension ( ) : Promise < FlowrExtensionApi > {
1313 const ext = vscode . extensions . getExtension ( 'code-inspect.vscode-flowr' ) ;
1414
1515 assert . notEqual ( ext , undefined , 'extension not found' ) ;
1616
1717 await assert . doesNotReject ( async ( ) => {
18- await ext ?. activate ( ) ;
18+ if ( ! ext ?. isActive ) {
19+ await ext ?. activate ( ) ;
20+ }
1921 } , 'extension activation failed' ) ;
2022
2123 const api = ( ext as vscode . Extension < FlowrExtensionApi > ) . exports ;
2224 assert . notEqual ( api , undefined , 'extension api not found' ) ;
2325
24- // force start a local shell and wait, since there seem to be some async issues with commands
26+ // force (re-) start local shell and wait, since there seem to be some async issues with commands
2527 const session : FlowrInternalSession = await vscode . commands . executeCommand ( 'vscode-flowr.session.internal' ) ;
2628 assert . equal ( session . state , 'active' ) ;
2729
You can’t perform that action at this time.
0 commit comments