mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
internal: remove UnindexedProject notification
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
This commit is contained in:
parent
b2e3cec51e
commit
2783aa7312
15 changed files with 14 additions and 366 deletions
|
@ -2,9 +2,9 @@ import * as Is from "vscode-languageclient/lib/common/utils/is";
|
|||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { type Env, log, unwrapUndefinable, expectNotUndefined } from "./util";
|
||||
import type { JsonProject } from "./rust_project";
|
||||
import type { Disposable } from "./ctx";
|
||||
import { expectNotUndefined, log, unwrapUndefinable } from "./util";
|
||||
import type { Env } from "./util";
|
||||
import type { Disposable } from "vscode";
|
||||
|
||||
export type RunnableEnvCfgItem = {
|
||||
mask?: string;
|
||||
|
@ -31,7 +31,6 @@ export class Config {
|
|||
);
|
||||
|
||||
constructor(disposables: Disposable[]) {
|
||||
this.discoveredWorkspaces = [];
|
||||
vscode.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration, this, disposables);
|
||||
this.refreshLogging();
|
||||
this.configureLanguage();
|
||||
|
@ -52,8 +51,6 @@ export class Config {
|
|||
log.info("Using configuration", Object.fromEntries(cfg));
|
||||
}
|
||||
|
||||
public discoveredWorkspaces: JsonProject[];
|
||||
|
||||
private async onDidChangeConfiguration(event: vscode.ConfigurationChangeEvent) {
|
||||
this.refreshLogging();
|
||||
|
||||
|
@ -342,18 +339,7 @@ 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>(
|
||||
resp: T,
|
||||
cb?: (key: Extract<keyof T, string>, res: { [key: string]: any }) => void,
|
||||
): T {
|
||||
export function prepareVSCodeConfig<T>(resp: T): T {
|
||||
if (Is.string(resp)) {
|
||||
return substituteVSCodeVariableInString(resp) as T;
|
||||
} else if (resp && Is.array<any>(resp)) {
|
||||
|
@ -365,9 +351,6 @@ export function prepareVSCodeConfig<T>(
|
|||
for (const key in resp) {
|
||||
const val = resp[key];
|
||||
res[key] = prepareVSCodeConfig(val);
|
||||
if (cb) {
|
||||
cb(key, res);
|
||||
}
|
||||
}
|
||||
return res as T;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue