Push IO and error handling up

This commit is contained in:
Aleksey Kladov 2020-02-17 14:03:33 +01:00
parent 6167101302
commit ee4e41cbea
3 changed files with 13 additions and 14 deletions

View file

@ -23,16 +23,10 @@ export class Ctx {
this.extCtx = extCtx;
}
async startServer() {
async startServer(serverPath: string) {
assert(this.client == null);
const client = await createClient(this.config);
if (!client) {
throw new Error(
"Rust Analyzer Language Server is not available. " +
"Please, ensure its [proper installation](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#vs-code)."
);
}
const client = await createClient(this.config, serverPath);
this.pushCleanup(client.start());
await client.onReady();