mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Remove unnecessary async from vscode language client creation
This commit is contained in:
parent
fc57358efd
commit
5f88df82a6
2 changed files with 2 additions and 2 deletions
|
@ -4,7 +4,7 @@ import * as vscode from 'vscode';
|
||||||
import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
|
import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
|
||||||
import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed';
|
import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed';
|
||||||
|
|
||||||
export async function createClient(serverPath: string, cwd: string): Promise<lc.LanguageClient> {
|
export function createClient(serverPath: string, cwd: string): lc.LanguageClient {
|
||||||
// '.' Is the fallback if no folder is open
|
// '.' Is the fallback if no folder is open
|
||||||
// TODO?: Workspace folders support Uri's (eg: file://test.txt).
|
// TODO?: Workspace folders support Uri's (eg: file://test.txt).
|
||||||
// It might be a good idea to test if the uri points to a file.
|
// It might be a good idea to test if the uri points to a file.
|
||||||
|
|
|
@ -21,7 +21,7 @@ export class Ctx {
|
||||||
serverPath: string,
|
serverPath: string,
|
||||||
cwd: string,
|
cwd: string,
|
||||||
): Promise<Ctx> {
|
): Promise<Ctx> {
|
||||||
const client = await createClient(serverPath, cwd);
|
const client = createClient(serverPath, cwd);
|
||||||
const res = new Ctx(config, extCtx, client, serverPath);
|
const res = new Ctx(config, extCtx, client, serverPath);
|
||||||
res.pushCleanup(client.start());
|
res.pushCleanup(client.start());
|
||||||
await client.onReady();
|
await client.onReady();
|
||||||
|
|
Loading…
Reference in a new issue