@@ -52,7 +52,7 @@ export async function activate(context: ExtensionContext) {
52
52
context . subscriptions . push ( ...registerCommands ( ) ) ;
53
53
54
54
workspace . onDidOpenTextDocument ( doc => whenOpeningTextDocument ( doc ) ) ;
55
- workspace . onDidChangeWorkspaceFolders ( e => whenChangingWorkspaceFolders ( e ) ) ;
55
+ workspace . onDidChangeWorkspaceFolders ( whenChangingWorkspaceFolders ) ;
56
56
window . onDidChangeActiveTextEditor (
57
57
ed => ed && whenOpeningTextDocument ( ed . document ) ,
58
58
) ;
@@ -124,23 +124,6 @@ function whenOpeningTextDocument(document: TextDocument) {
124
124
}
125
125
126
126
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
-
144
127
// If a workspace is removed which is a Rust workspace, kill the client.
145
128
for ( const folder of e . removed ) {
146
129
const ws = workspaces . get ( folder . uri . toString ( ) ) ;
0 commit comments