File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export class RubyLsp {
3333
3434 // A URI => content map of virtual documents for delegate requests
3535 private readonly virtualDocuments = new Map < string , string > ( ) ;
36+ private readonly workspacesBeingLaunched : Set < number > = new Set ( ) ;
3637
3738 constructor (
3839 context : vscode . ExtensionContext ,
@@ -83,14 +84,18 @@ export class RubyLsp {
8384 document . uri ,
8485 ) ;
8586
86- if ( ! workspaceFolder ) {
87+ if (
88+ ! workspaceFolder ||
89+ this . workspacesBeingLaunched . has ( workspaceFolder . index )
90+ ) {
8791 return ;
8892 }
8993
9094 const workspace = this . getWorkspace ( workspaceFolder . uri ) ;
9195
9296 // If the workspace entry doesn't exist, then we haven't activated the workspace yet
9397 if ( ! workspace ) {
98+ this . workspacesBeingLaunched . add ( workspaceFolder . index ) ;
9499 await this . activateWorkspace ( workspaceFolder , false ) ;
95100 }
96101 } ) ,
@@ -230,6 +235,7 @@ export class RubyLsp {
230235 true ,
231236 ) ;
232237 await this . showFormatOnSaveModeWarning ( workspace ) ;
238+ this . workspacesBeingLaunched . delete ( workspaceFolder . index ) ;
233239 }
234240
235241 // Registers all extension commands. Commands can only be registered once, so this happens in the constructor. For
You can’t perform that action at this time.
0 commit comments