@@ -92,14 +92,13 @@ function didOpenTextDocument(
92
92
const folderPath = folder . uri . toString ( ) ;
93
93
94
94
if ( ! workspaces . has ( folderPath ) ) {
95
-
96
95
const workspace = new ClientWorkspace ( folder ) ;
97
96
activeWorkspace = workspace ;
98
97
workspaces . set ( folderPath , workspace ) ;
99
98
workspace . start ( context ) ;
100
99
} else {
101
100
const ws = workspaces . get ( folderPath ) ;
102
- activeWorkspace = typeof ws === " undefined" ? null : ws ;
101
+ activeWorkspace = typeof ws === ' undefined' ? null : ws ;
103
102
}
104
103
}
105
104
@@ -234,16 +233,19 @@ class ClientWorkspace {
234
233
warnOnMissingCargoToml ( ) ;
235
234
}
236
235
237
-
238
236
startSpinner ( 'RLS' , 'Starting' ) ;
239
237
240
238
const serverOptions : ServerOptions = async ( ) => {
241
239
await this . autoUpdate ( ) ;
242
240
return this . makeRlsProcess ( ) ;
243
241
} ;
244
242
245
- const pattern = this . config . multiProjectEnabled ? `${ this . folder . uri . path } /**` : undefined ;
246
- const collectionName = this . config . multiProjectEnabled ? `rust ${ this . folder . uri . toString ( ) } ` : 'rust' ;
243
+ const pattern = this . config . multiProjectEnabled
244
+ ? `${ this . folder . uri . path } /**`
245
+ : undefined ;
246
+ const collectionName = this . config . multiProjectEnabled
247
+ ? `rust ${ this . folder . uri . toString ( ) } `
248
+ : 'rust' ;
247
249
const clientOptions : LanguageClientOptions = {
248
250
// Register the server for Rust files
249
251
@@ -287,7 +289,9 @@ class ClientWorkspace {
287
289
clientOptions ,
288
290
) ;
289
291
290
- const selector = this . config . multiProjectEnabled ? { language : 'rust' , scheme : 'file' , pattern } : { language : 'rust' } ;
292
+ const selector = this . config . multiProjectEnabled
293
+ ? { language : 'rust' , scheme : 'file' , pattern }
294
+ : { language : 'rust' } ;
291
295
292
296
this . setupProgressCounter ( ) ;
293
297
this . registerCommands ( context , this . config . multiProjectEnabled ) ;
@@ -312,7 +316,10 @@ class ClientWorkspace {
312
316
commandsUnregistered = true ;
313
317
}
314
318
315
- private registerCommands ( context : ExtensionContext , multiProjectEnabled : boolean ) {
319
+ private registerCommands (
320
+ context : ExtensionContext ,
321
+ multiProjectEnabled : boolean ,
322
+ ) {
316
323
if ( ! this . lc ) {
317
324
return ;
318
325
}
@@ -324,27 +331,27 @@ class ClientWorkspace {
324
331
const rustupUpdateDisposable = commands . registerCommand (
325
332
'rls.update' ,
326
333
( ) => {
327
- const ws = multiProjectEnabled && activeWorkspace ? activeWorkspace : this ;
334
+ const ws =
335
+ multiProjectEnabled && activeWorkspace ? activeWorkspace : this ;
328
336
return rustupUpdate ( ws . config . rustupConfig ( ) ) ;
329
337
} ,
330
338
) ;
331
339
this . disposables . push ( rustupUpdateDisposable ) ;
332
340
333
341
const restartServer = commands . registerCommand ( 'rls.restart' , async ( ) => {
334
- const ws = multiProjectEnabled && activeWorkspace ? activeWorkspace : this ;
342
+ const ws =
343
+ multiProjectEnabled && activeWorkspace ? activeWorkspace : this ;
335
344
await ws . stop ( ) ;
336
345
return ws . start ( context ) ;
337
-
338
346
} ) ;
339
347
this . disposables . push ( restartServer ) ;
340
348
341
349
this . disposables . push (
342
350
commands . registerCommand ( 'rls.run' , ( cmd : Execution ) => {
343
- const ws = multiProjectEnabled && activeWorkspace ? activeWorkspace : this ;
344
- runRlsCommand ( ws . folder , cmd )
345
- } ,
346
-
347
- ) ,
351
+ const ws =
352
+ multiProjectEnabled && activeWorkspace ? activeWorkspace : this ;
353
+ runRlsCommand ( ws . folder , cmd ) ;
354
+ } ) ,
348
355
) ;
349
356
}
350
357
0 commit comments