aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/src/client.ts4
-rw-r--r--editors/code/src/ctx.ts8
-rw-r--r--editors/code/src/main.ts4
3 files changed, 8 insertions, 8 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index cb8beb343..69dbe2535 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -33,7 +33,7 @@ export function createClient(serverPath: string, workspace: Workspace, extraEnv:
33 Object.assign(newEnv, extraEnv); 33 Object.assign(newEnv, extraEnv);
34 34
35 let cwd = undefined; 35 let cwd = undefined;
36 if (workspace.kind == "Workspace Folder") { 36 if (workspace.kind === "Workspace Folder") {
37 cwd = workspace.folder.fsPath; 37 cwd = workspace.folder.fsPath;
38 }; 38 };
39 39
@@ -50,7 +50,7 @@ export function createClient(serverPath: string, workspace: Workspace, extraEnv:
50 ); 50 );
51 51
52 let initializationOptions = vscode.workspace.getConfiguration("rust-analyzer"); 52 let initializationOptions = vscode.workspace.getConfiguration("rust-analyzer");
53 if (workspace.kind == "Detached files") { 53 if (workspace.kind === "Detached Files") {
54 initializationOptions = { "detachedFiles": workspace.files.map(file => file.uri.fsPath), ...initializationOptions }; 54 initializationOptions = { "detachedFiles": workspace.files.map(file => file.uri.fsPath), ...initializationOptions };
55 } 55 }
56 56
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index dbfb9c6a1..22c5f62a1 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -9,12 +9,12 @@ import { ServerStatusParams } from './lsp_ext';
9 9
10export type Workspace = 10export type Workspace =
11 { 11 {
12 kind: 'Workspace Folder', 12 kind: 'Workspace Folder';
13 folder: vscode.Uri, 13 folder: vscode.Uri;
14 } 14 }
15 | { 15 | {
16 kind: 'Detached files', 16 kind: 'Detached Files';
17 files: vscode.TextDocument[], 17 files: vscode.TextDocument[];
18 }; 18 };
19 19
20export class Ctx { 20export class Ctx {
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 1a4af548d..b735186fe 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -47,9 +47,9 @@ async function tryActivate(context: vscode.ExtensionContext) {
47 47
48 const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; 48 const workspaceFolder = vscode.workspace.workspaceFolders?.[0];
49 if (workspaceFolder === undefined) { 49 if (workspaceFolder === undefined) {
50 let rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document)); 50 const rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document));
51 if (rustDocuments.length > 0) { 51 if (rustDocuments.length > 0) {
52 ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached files', files: rustDocuments }); 52 ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached Files', files: rustDocuments });
53 } else { 53 } else {
54 throw new Error("no rust files are opened"); 54 throw new Error("no rust files are opened");
55 } 55 }