about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--editors/code/src/ctx.ts24
1 files changed, 7 insertions, 17 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index 21f1025cf3a..dfc8aa7b9da 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -5,17 +5,13 @@ import { Config } from './config';
 import { createClient } from './client';
 
 export class Ctx {
-    readonly config: Config;
-    // Because we have "reload server" action, various listeners **will** face a
-    // situation where the client is not ready yet, and should be prepared to
-    // deal with it.
-    //
-    // Ideally, this should be replaced with async getter though.
-    // FIXME: this actually needs syncronization of some kind (check how
-    // vscode deals with `deactivate()` call when extension has some work scheduled
-    // on the event loop to get a better picture of what we can do here)
-    client: lc.LanguageClient;
-    private extCtx: vscode.ExtensionContext;
+    private constructor(
+        readonly config: Config,
+        private readonly extCtx: vscode.ExtensionContext,
+        readonly client: lc.LanguageClient
+    ) {
+
+    }
 
     static async create(config: Config, extCtx: vscode.ExtensionContext, serverPath: string): Promise<Ctx> {
         const client = await createClient(config, serverPath);
@@ -25,12 +21,6 @@ export class Ctx {
         return res;
     }
 
-    private constructor(config: Config, extCtx: vscode.ExtensionContext, client: lc.LanguageClient) {
-        this.config = config;
-        this.extCtx = extCtx;
-        this.client = client
-    }
-
     get activeRustEditor(): vscode.TextEditor | undefined {
         const editor = vscode.window.activeTextEditor;
         return editor && editor.document.languageId === 'rust'