@@ -2,9 +2,9 @@ import * as Is from "vscode-languageclient/lib/common/utils/is";
2
2
import * as os from "os" ;
3
3
import * as path from "path" ;
4
4
import * as vscode from "vscode" ;
5
- import { type Env , log , unwrapUndefinable , expectNotUndefined } from "./util" ;
6
- import type { JsonProject } from "./rust_project " ;
7
- import type { Disposable } from "./ctx " ;
5
+ import { expectNotUndefined , log , unwrapUndefinable } from "./util" ;
6
+ import type { Env } from "./util " ;
7
+ import type { Disposable } from "vscode " ;
8
8
9
9
export type RunnableEnvCfgItem = {
10
10
mask ?: string ;
@@ -31,7 +31,6 @@ export class Config {
31
31
) ;
32
32
33
33
constructor ( disposables : Disposable [ ] ) {
34
- this . discoveredWorkspaces = [ ] ;
35
34
vscode . workspace . onDidChangeConfiguration ( this . onDidChangeConfiguration , this , disposables ) ;
36
35
this . refreshLogging ( ) ;
37
36
this . configureLanguage ( ) ;
@@ -52,8 +51,6 @@ export class Config {
52
51
log . info ( "Using configuration" , Object . fromEntries ( cfg ) ) ;
53
52
}
54
53
55
- public discoveredWorkspaces : JsonProject [ ] ;
56
-
57
54
private async onDidChangeConfiguration ( event : vscode . ConfigurationChangeEvent ) {
58
55
this . refreshLogging ( ) ;
59
56
@@ -342,18 +339,7 @@ export class Config {
342
339
}
343
340
}
344
341
345
- // the optional `cb?` parameter is meant to be used to add additional
346
- // key/value pairs to the VS Code configuration. This needed for, e.g.,
347
- // including a `rust-project.json` into the `linkedProjects` key as part
348
- // of the configuration/InitializationParams _without_ causing VS Code
349
- // configuration to be written out to workspace-level settings. This is
350
- // undesirable behavior because rust-project.json files can be tens of
351
- // thousands of lines of JSON, most of which is not meant for humans
352
- // to interact with.
353
- export function prepareVSCodeConfig < T > (
354
- resp : T ,
355
- cb ?: ( key : Extract < keyof T , string > , res : { [ key : string ] : any } ) => void ,
356
- ) : T {
342
+ export function prepareVSCodeConfig < T > ( resp : T ) : T {
357
343
if ( Is . string ( resp ) ) {
358
344
return substituteVSCodeVariableInString ( resp ) as T ;
359
345
} else if ( resp && Is . array < any > ( resp ) ) {
@@ -365,9 +351,6 @@ export function prepareVSCodeConfig<T>(
365
351
for ( const key in resp ) {
366
352
const val = resp [ key ] ;
367
353
res [ key ] = prepareVSCodeConfig ( val ) ;
368
- if ( cb ) {
369
- cb ( key , res ) ;
370
- }
371
354
}
372
355
return res as T ;
373
356
}
0 commit comments