mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Address review comments
This commit is contained in:
parent
78aed305e1
commit
bd545a1c10
@ -96,7 +96,9 @@ export async function createClient(
|
|||||||
if (resp && Array.isArray(resp)) {
|
if (resp && Array.isArray(resp)) {
|
||||||
return resp.map((val) => {
|
return resp.map((val) => {
|
||||||
return prepareVSCodeConfig(val, (key, cfg) => {
|
return prepareVSCodeConfig(val, (key, cfg) => {
|
||||||
cfg[key] = config.discoveredWorkspaces;
|
if (key === "linkedProjects") {
|
||||||
|
cfg[key] = config.discoveredWorkspaces;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -287,6 +287,14 @@ export class Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the optional `cb?` parameter is meant to be used to add additional
|
||||||
|
// key/value pairs to the VS Code configuration. This needed for, e.g.,
|
||||||
|
// including a `rust-project.json` into the `linkedProjects` key as part
|
||||||
|
// of the configuration/InitializationParams _without_ causing VS Code
|
||||||
|
// configuration to be written out to workspace-level settings. This is
|
||||||
|
// undesirable behavior because rust-project.json files can be tens of
|
||||||
|
// thousands of lines of JSON, most of which is not meant for humans
|
||||||
|
// to interact with.
|
||||||
export function prepareVSCodeConfig<T>(
|
export function prepareVSCodeConfig<T>(
|
||||||
resp: T,
|
resp: T,
|
||||||
cb?: (key: Extract<keyof T, string>, res: { [key: string]: any }) => void
|
cb?: (key: Extract<keyof T, string>, res: { [key: string]: any }) => void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user