fix(problems): start TypeScript Project Errors when the option is turned on (#6316)

The desktop app's settings_set has its own copy of the side effects of a
changed setting, and the tsc --watch watcher was only started from the host
command's copy, so turning on Problems › TypeScript Project Errors did
nothing until the project was reopened. Both commands now share
apply_setting, which also applies the terminal frame rate on desktop.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-27 10:28:13 +08:00
1 джерело db8224f74e
коміт 0cce0a9840
2 files changed
+18 -14

No files matched your search

+17 -11
Переглянути файл
@@ -110,6 +110,22 @@ pub fn settings_removed_theme(host: &Host, window: &str) -> Option<String> {
}
}
/// What a changed setting `key` starts or stops right away. Both `settings_set` commands (this
/// crate's and the desktop's) call it after writing the value.
pub fn apply_setting(host: &Arc<Host>, window: &str, key: &str) {
if key == "mcpServer" || key.starts_with("mcpServer.") {
host.mcp.apply(host);
}
if key == "terminal" || key.starts_with("terminal.") {
super::term::apply_output_rate(host, window);
}
if "languages.typescript.watchProblems".starts_with(key)
&& let Some(watch) = host.project(window).ok().and_then(|p| p.tsc_watch.clone())
{
watch.apply(&host.runtime);
}
}
/// `value` is JSON text, e.g. `14` or `"dark"`. Every window (for a project
/// value: that project's windows) is told (`IdeEvent::SettingsChanged`) so it
/// re-reads its effective settings.
@@ -122,17 +138,7 @@ pub fn settings_set(
value: String,
) -> IdeResult<Settings> {
let applied = set_settings(host, window, scope, &key, &value)?;
if key == "mcpServer" || key.starts_with("mcpServer.") {
host.mcp.apply(host);
}
if key == "terminal" || key.starts_with("terminal.") {
super::term::apply_output_rate(host, window);
}
if "languages.typescript.watchProblems".starts_with(&key)
&& let Some(watch) = host.project(window).ok().and_then(|p| p.tsc_watch.clone())
{
watch.apply(&host.runtime);
}
apply_setting(host, window, &key);
let sink = host.window_sink(window);
sink.emit(IdeEvent::SettingsChanged { key });
if let Some(root) = applied.roots_changed {
+1 -3
Переглянути файл
@@ -240,9 +240,7 @@ fn settings_set_now(
value: &str,
) -> IdeResult<Settings> {
let applied = ide_host::ops::project::set_settings(&state.host, window, scope, key, value)?;
if key == "mcpServer" || key.starts_with("mcpServer.") {
state.host.mcp.apply(&state.host);
}
ide_host::ops::project::apply_setting(&state.host, window, key);
if key == "toolDownloads" || key.starts_with("toolDownloads.") {
state.plugins.set_downloads(state.host.global_settings.effective().tool_downloads);
}