debugger beta: Improve resolve debug scenario error message (#32504)
When no locator or valid config is found we expose the invalid config error message to the user now. Closes #32067 Release Notes: - debugger beta: Improve error message when starting a debugger session with an invalid configuration
This commit is contained in:
parent
7a14987c02
commit
444f797827
1 changed files with 7 additions and 9 deletions
|
@ -818,7 +818,7 @@ impl RunningState {
|
||||||
|
|
||||||
let request_type = dap_registry
|
let request_type = dap_registry
|
||||||
.adapter(&adapter)
|
.adapter(&adapter)
|
||||||
.ok_or_else(|| anyhow!("{}: is not a valid adapter name", &adapter))
|
.with_context(|| format!("{}: is not a valid adapter name", &adapter))
|
||||||
.and_then(|adapter| adapter.request_kind(&config));
|
.and_then(|adapter| adapter.request_kind(&config));
|
||||||
|
|
||||||
let config_is_valid = request_type.is_ok();
|
let config_is_valid = request_type.is_ok();
|
||||||
|
@ -932,15 +932,13 @@ impl RunningState {
|
||||||
};
|
};
|
||||||
|
|
||||||
if config_is_valid {
|
if config_is_valid {
|
||||||
// Ok(DebugTaskDefinition {
|
|
||||||
// label,
|
|
||||||
// adapter: DebugAdapterName(adapter),
|
|
||||||
// config,
|
|
||||||
// tcp_connection,
|
|
||||||
// })
|
|
||||||
} else if let Some((task, locator_name)) = build_output {
|
} else if let Some((task, locator_name)) = build_output {
|
||||||
let locator_name =
|
let locator_name =
|
||||||
locator_name.context("Could not find a valid locator for a build task")?;
|
locator_name.with_context(|| {
|
||||||
|
format!("Could not find a valid locator for a build task and configure is invalid with error: {}", request_type.err()
|
||||||
|
.map(|err| err.to_string())
|
||||||
|
.unwrap_or_default())
|
||||||
|
})?;
|
||||||
let request = dap_store
|
let request = dap_store
|
||||||
.update(cx, |this, cx| {
|
.update(cx, |this, cx| {
|
||||||
this.run_debug_locator(&locator_name, task, cx)
|
this.run_debug_locator(&locator_name, task, cx)
|
||||||
|
@ -956,7 +954,7 @@ impl RunningState {
|
||||||
|
|
||||||
let scenario = dap_registry
|
let scenario = dap_registry
|
||||||
.adapter(&adapter)
|
.adapter(&adapter)
|
||||||
.ok_or_else(|| anyhow!("{}: is not a valid adapter name", &adapter))
|
.with_context(|| anyhow!("{}: is not a valid adapter name", &adapter))
|
||||||
.map(|adapter| adapter.config_from_zed_format(zed_config))??;
|
.map(|adapter| adapter.config_from_zed_format(zed_config))??;
|
||||||
config = scenario.config;
|
config = scenario.config;
|
||||||
Self::substitute_variables_in_config(&mut config, &task_context);
|
Self::substitute_variables_in_config(&mut config, &task_context);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue