Skip to content

Commit bd545a1

Browse files
committed
Address review comments
1 parent 78aed30 commit bd545a1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

editors/code/src/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ export async function createClient(
9696
if (resp && Array.isArray(resp)) {
9797
return resp.map((val) => {
9898
return prepareVSCodeConfig(val, (key, cfg) => {
99-
cfg[key] = config.discoveredWorkspaces;
99+
if (key === "linkedProjects") {
100+
cfg[key] = config.discoveredWorkspaces;
101+
}
100102
});
101103
});
102104
} else {

editors/code/src/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,14 @@ export class Config {
287287
}
288288
}
289289

290+
// the optional `cb?` parameter is meant to be used to add additional
291+
// key/value pairs to the VS Code configuration. This needed for, e.g.,
292+
// including a `rust-project.json` into the `linkedProjects` key as part
293+
// of the configuration/InitializationParams _without_ causing VS Code
294+
// configuration to be written out to workspace-level settings. This is
295+
// undesirable behavior because rust-project.json files can be tens of
296+
// thousands of lines of JSON, most of which is not meant for humans
297+
// to interact with.
290298
export function prepareVSCodeConfig<T>(
291299
resp: T,
292300
cb?: (key: Extract<keyof T, string>, res: { [key: string]: any }) => void

0 commit comments

Comments
 (0)