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

Commit 4ed04a8

Browse files
committed
Don't immediately try to start server instance for new workspace folders
1 parent 30694bd commit 4ed04a8

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### Unreleased
22

3+
* (!) Don't immediately try to start server instance for newly added workspace folders
34
* Use smooth, universally supported spinner in the status bar ⚙️
45

56
### 0.7.3 - 2020-04-21

src/extension.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function activate(context: ExtensionContext) {
5252
context.subscriptions.push(...registerCommands());
5353

5454
workspace.onDidOpenTextDocument(doc => whenOpeningTextDocument(doc));
55-
workspace.onDidChangeWorkspaceFolders(e => whenChangingWorkspaceFolders(e));
55+
workspace.onDidChangeWorkspaceFolders(whenChangingWorkspaceFolders);
5656
window.onDidChangeActiveTextEditor(
5757
ed => ed && whenOpeningTextDocument(ed.document),
5858
);
@@ -124,23 +124,6 @@ function whenOpeningTextDocument(document: TextDocument) {
124124
}
125125

126126
function whenChangingWorkspaceFolders(e: WorkspaceFoldersChangeEvent) {
127-
// If a VSCode workspace has been added, check to see if it is part of an existing one, and
128-
// if not, and it is a Rust project (i.e., has a Cargo.toml), then create a new client.
129-
for (let folder of e.added) {
130-
folder = getOuterMostWorkspaceFolder(folder);
131-
if (workspaces.has(folder.uri.toString())) {
132-
continue;
133-
}
134-
for (const f of fs.readdirSync(folder.uri.fsPath)) {
135-
if (f === 'Cargo.toml') {
136-
const workspace = new ClientWorkspace(folder);
137-
workspaces.set(folder.uri.toString(), workspace);
138-
workspace.start();
139-
break;
140-
}
141-
}
142-
}
143-
144127
// If a workspace is removed which is a Rust workspace, kill the client.
145128
for (const folder of e.removed) {
146129
const ws = workspaces.get(folder.uri.toString());

0 commit comments

Comments
 (0)