@@ -57,7 +57,7 @@ parameterizedDescribe(function (errorRecovery: boolean) {
5757 await sleep ( Delays . normal ) ;
5858 }
5959
60- async function loadPico ( ) {
60+ async function loadPico ( unregisterFirst = true ) {
6161 const repl = new RascalREPL ( bench , driver ) ;
6262 await repl . start ( ) ;
6363 await repl . execute ( "import testing::lang::pico::LanguageServer;" , false , Delays . extremelySlow ) ;
@@ -68,7 +68,9 @@ parameterizedDescribe(function (errorRecovery: boolean) {
6868 // is fixed (race between `unregister` and `register`), the
6969 // unregistration can't reliably be done as part of `main` (tried in
7070 // commit `a955a05`). Instead, it's done here.
71- await unloadPico ( repl ) ;
71+ if ( unregisterFirst ) {
72+ await unloadPico ( repl ) ;
73+ }
7274
7375 const replExecuteMain = repl . execute ( `register(errorRecovery=${ errorRecovery } );` ) ; // we don't wait yet, because we might miss pico loading window
7476 const ide = new IDEOperations ( browser ) ;
460462 const editor = await ide . openModule ( TestWorkspace . picoFile ) ;
461463 await setParametricLanguage ( editor ) ;
462464
463- await loadPico ( ) ;
465+ await loadPico ( false ) ;
466+
467+ // Statically registered capability
464468 await ide . hasSyntaxHighlighting ( editor , Delays . slow ) ;
469+ // Dynamically registered capability
470+ await driver . wait ( ( ) => editor . getCodeLens ( "Rename variables a to b." ) , Delays . fast , "Code lenses should be shown" ) ;
465471 } ) ;
466472} ) ;
0 commit comments