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

Commit be720b3

Browse files
committed
Document auto-starting behaviour of ClientWorkspace#autoStart
1 parent 3ff6c53 commit be720b3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/extension.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function clientWorkspaceForUri(
160160
if (!existing && options && options.startIfMissing) {
161161
const workspace = new ClientWorkspace(folder);
162162
workspaces.set(folder.uri.toString(), workspace);
163-
workspace.auto_start();
163+
workspace.autoStart();
164164
}
165165

166166
return workspaces.get(folder.uri.toString());
@@ -188,10 +188,13 @@ class ClientWorkspace {
188188
this._progress = new Observable<{ message: string } | null>(null);
189189
}
190190

191-
public auto_start() {
192-
if (this.config.autoStartRls) {
193-
this.start();
194-
}
191+
/**
192+
* Attempts to start a server instance, if not configured otherwise via
193+
* applicable `rust-client.autoStartRls` setting.
194+
* @returns whether the server has started.
195+
*/
196+
public async autoStart() {
197+
return this.config.autoStartRls && this.start().then(() => true);
195198
}
196199

197200
public async start() {

0 commit comments

Comments
 (0)