Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit 3eb24b2

Browse files
committed
apply pretty
1 parent f8d41bb commit 3eb24b2

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

src/configuration.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ export class RLSConfiguration {
119119
}
120120

121121
public get multiProjectEnabled(): boolean {
122-
return this.configuration.get<boolean>('rust-client.enableMultiProjectSetup', false);
122+
return this.configuration.get<boolean>(
123+
'rust-client.enableMultiProjectSetup',
124+
false,
125+
);
123126
}
124127

125128
// Added ignoreChannel for readChannel function. Otherwise we end in an infinite loop.

src/extension.ts

+22-15
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,13 @@ function didOpenTextDocument(
9292
const folderPath = folder.uri.toString();
9393

9494
if (!workspaces.has(folderPath)) {
95-
9695
const workspace = new ClientWorkspace(folder);
9796
activeWorkspace = workspace;
9897
workspaces.set(folderPath, workspace);
9998
workspace.start(context);
10099
} else {
101100
const ws = workspaces.get(folderPath);
102-
activeWorkspace = typeof ws === "undefined" ? null : ws;
101+
activeWorkspace = typeof ws === 'undefined' ? null : ws;
103102
}
104103
}
105104

@@ -234,16 +233,19 @@ class ClientWorkspace {
234233
warnOnMissingCargoToml();
235234
}
236235

237-
238236
startSpinner('RLS', 'Starting');
239237

240238
const serverOptions: ServerOptions = async () => {
241239
await this.autoUpdate();
242240
return this.makeRlsProcess();
243241
};
244242

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';
247249
const clientOptions: LanguageClientOptions = {
248250
// Register the server for Rust files
249251

@@ -287,7 +289,9 @@ class ClientWorkspace {
287289
clientOptions,
288290
);
289291

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' };
291295

292296
this.setupProgressCounter();
293297
this.registerCommands(context, this.config.multiProjectEnabled);
@@ -312,7 +316,10 @@ class ClientWorkspace {
312316
commandsUnregistered = true;
313317
}
314318

315-
private registerCommands(context: ExtensionContext, multiProjectEnabled: boolean) {
319+
private registerCommands(
320+
context: ExtensionContext,
321+
multiProjectEnabled: boolean,
322+
) {
316323
if (!this.lc) {
317324
return;
318325
}
@@ -324,27 +331,27 @@ class ClientWorkspace {
324331
const rustupUpdateDisposable = commands.registerCommand(
325332
'rls.update',
326333
() => {
327-
const ws = multiProjectEnabled && activeWorkspace ? activeWorkspace : this;
334+
const ws =
335+
multiProjectEnabled && activeWorkspace ? activeWorkspace : this;
328336
return rustupUpdate(ws.config.rustupConfig());
329337
},
330338
);
331339
this.disposables.push(rustupUpdateDisposable);
332340

333341
const restartServer = commands.registerCommand('rls.restart', async () => {
334-
const ws = multiProjectEnabled && activeWorkspace ? activeWorkspace : this;
342+
const ws =
343+
multiProjectEnabled && activeWorkspace ? activeWorkspace : this;
335344
await ws.stop();
336345
return ws.start(context);
337-
338346
});
339347
this.disposables.push(restartServer);
340348

341349
this.disposables.push(
342350
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+
}),
348355
);
349356
}
350357

0 commit comments

Comments
 (0)