fix(debugger): offer to install Bash Debug, and point debugger hints to Settings (#1637)

Bash Debug had no entry in the missing-adapter table, so a shell script debug session without it failed with a plain error pointing at mason.nvim. The install hints of the debuggers OpenIDEA installs itself (CodeLLDB, vscode-js-debug, Kotlin Debug Adapter, netcoredbg, Bash Debug) now point to Settings › Languages & Frameworks › Language Servers, in languages/*.toml and in ide-dap's built-in definitions.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-06 06:35:01 +08:00
1 джерело a6cf4442d8
коміт e6b800971a
14 files changed
+20 -15

No files matched your search

+5 -5
Переглянути файл
@@ -64,13 +64,13 @@ fn builtin(adapter: &str) -> Option<DebuggerConfig> {
"codelldb",
&["--port", PORT_PLACEHOLDER],
"tcp",
"Install the CodeLLDB adapter (https://github.com/vadimcn/codelldb/releases) and put `codelldb` on PATH",
"Install CodeLLDB in Settings › Languages & Frameworks › Language Servers",
),
"kotlin-debug-adapter" => cfg(
"kotlin-debug-adapter",
&[],
"stdio",
"Install the Kotlin Debug Adapter from Settings > Language Servers",
"Install Kotlin Debug Adapter in Settings › Languages & Frameworks › Language Servers",
),
// Windows installs `python.exe`; `python3.exe` there is at most a Store alias.
"debugpy" => cfg(
@@ -84,7 +84,7 @@ fn builtin(adapter: &str) -> Option<DebuggerConfig> {
// Without a host it listens on `localhost`, which may resolve to ::1 only.
&[PORT_PLACEHOLDER, "127.0.0.1"],
"tcp",
"Install vscode-js-debug's DAP server (js-debug-dap-*.tar.gz from https://github.com/microsoft/vscode-js-debug/releases) as `js-debug-adapter`",
"Install JavaScript Debugger (vscode-js-debug) in Settings › Languages & Frameworks › Language Servers",
),
"delve" => cfg(
"dlv",
@@ -96,7 +96,7 @@ fn builtin(adapter: &str) -> Option<DebuggerConfig> {
"netcoredbg",
&["--interpreter=vscode"],
"stdio",
"Install Samsung netcoredbg (https://github.com/Samsung/netcoredbg/releases)",
"Install netcoredbg (.NET debugger) in Settings › Languages & Frameworks › Language Servers",
),
"lldb-dap" => {
cfg("lldb-dap", &[], "stdio", "Install LLVM's lldb-dap (brew install llvm; on macOS `xcrun -f lldb-dap`)")
@@ -668,7 +668,7 @@ mod tests {
assert!(find_binary("definitely-not-a-real-binary-openidea", &spec.cwd).is_none());
let err = missing(&spec);
assert_eq!(err.kind, ide_core::error::ErrorKind::Unavailable);
assert!(err.message.contains("netcoredbg/releases"));
assert!(err.message.contains("Settings › Languages & Frameworks › Language Servers"));
}
#[tokio::test]
+1 -1
Переглянути файл
@@ -17,4 +17,4 @@ install-hint = "dotnet tool install --global csharp-ls"
adapter = "netcoredbg"
command = "netcoredbg"
args = ["--interpreter=vscode"]
install-hint = "Install Samsung netcoredbg (https://github.com/Samsung/netcoredbg/releases)"
install-hint = "Install netcoredbg (.NET debugger) in Settings › Languages & Frameworks › Language Servers"
+1 -1
Переглянути файл
@@ -18,4 +18,4 @@ initialization-options = { AutomaticWorkspaceInit = true }
adapter = "netcoredbg"
command = "netcoredbg"
args = ["--interpreter=vscode"]
install-hint = "Install Samsung netcoredbg (https://github.com/Samsung/netcoredbg/releases)"
install-hint = "Install netcoredbg (.NET debugger) in Settings › Languages & Frameworks › Language Servers"
+1 -1
Переглянути файл
@@ -59,4 +59,4 @@ adapter = "js-debug"
command = "js-debug-adapter"
args = ["${port}", "127.0.0.1"]
transport = "tcp"
install-hint = "Install vscode-js-debug's DAP server (js-debug-dap-*.tar.gz from https://github.com/microsoft/vscode-js-debug/releases) as `js-debug-adapter`"
install-hint = "Install JavaScript Debugger (vscode-js-debug) in Settings › Languages & Frameworks › Language Servers"
+1 -1
Переглянути файл
@@ -58,4 +58,4 @@ adapter = "js-debug"
command = "js-debug-adapter"
args = ["${port}", "127.0.0.1"]
transport = "tcp"
install-hint = "Install vscode-js-debug's DAP server (js-debug-dap-*.tar.gz from https://github.com/microsoft/vscode-js-debug/releases) as `js-debug-adapter`"
install-hint = "Install JavaScript Debugger (vscode-js-debug) in Settings › Languages & Frameworks › Language Servers"
+1 -1
Переглянути файл
@@ -32,4 +32,4 @@ install-hint = "brew install kotlin-language-server (https://github.com/fwcd/kot
[debugger]
adapter = "kotlin-debug-adapter"
command = "kotlin-debug-adapter"
install-hint = "Install https://github.com/fwcd/kotlin-debug-adapter and put `kotlin-debug-adapter` on PATH"
install-hint = "Install Kotlin Debug Adapter in Settings › Languages & Frameworks › Language Servers"
+1 -1
Переглянути файл
@@ -23,4 +23,4 @@ adapter = "codelldb"
command = "codelldb"
args = ["--port", "${port}"]
transport = "tcp"
install-hint = "Install the CodeLLDB adapter (https://github.com/vadimcn/codelldb/releases) and put `codelldb` on PATH"
install-hint = "Install CodeLLDB in Settings › Languages & Frameworks › Language Servers"
+1 -1
Переглянути файл
@@ -17,4 +17,4 @@ install-hint = "npm i -g bash-language-server (optionally install shellcheck and
[debugger]
adapter = "bash-debug"
command = "bash-debug-adapter"
install-hint = "Install https://github.com/rogalmic/vscode-bash-debug as `bash-debug-adapter` (e.g. via mason.nvim)"
install-hint = "Install Bash Debug in Settings › Languages & Frameworks › Language Servers"
+1 -1
Переглянути файл
@@ -69,4 +69,4 @@ adapter = "js-debug"
command = "js-debug-adapter"
args = ["${port}", "127.0.0.1"]
transport = "tcp"
install-hint = "Install vscode-js-debug's DAP server (js-debug-dap-*.tar.gz from https://github.com/microsoft/vscode-js-debug/releases) as `js-debug-adapter`"
install-hint = "Install JavaScript Debugger (vscode-js-debug) in Settings › Languages & Frameworks › Language Servers"
+1 -1
Переглянути файл
@@ -58,4 +58,4 @@ adapter = "js-debug"
command = "js-debug-adapter"
args = ["${port}", "127.0.0.1"]
transport = "tcp"
install-hint = "Install vscode-js-debug's DAP server (js-debug-dap-*.tar.gz from https://github.com/microsoft/vscode-js-debug/releases) as `js-debug-adapter`"
install-hint = "Install JavaScript Debugger (vscode-js-debug) in Settings › Languages & Frameworks › Language Servers"
+1 -1
Переглянути файл
@@ -16,4 +16,4 @@ adapter = "codelldb"
command = "codelldb"
args = ["--port", "${port}"]
transport = "tcp"
install-hint = "Install the CodeLLDB adapter (https://github.com/vadimcn/codelldb/releases)"
install-hint = "Install CodeLLDB in Settings › Languages & Frameworks › Language Servers"
+3
Переглянути файл
@@ -25,6 +25,9 @@ describe("missing debug adapters", () => {
"netcoredbg",
);
expect(missingAdapter("delve", unavailable("debug adapter `delve` not found (x)"))?.tool).toBe("delve");
expect(missingAdapter("bash-debug", unavailable("debug adapter `bash-debug` not found (x)"))?.title).toBe(
"Bash Debug is not installed",
);
});
it("offers the managed install of the missing php-debug adapter", () => {
+1
Переглянути файл
@@ -13,6 +13,7 @@ const INSTALLABLE: Record<string, { tool: string; title: string }> = {
delve: { tool: "delve", title: "Delve is not installed" },
codelldb: { tool: "codelldb", title: "CodeLLDB is not installed" },
"php-debug": { tool: "php-debug", title: "PHP Debug (Xdebug) is not installed" },
"bash-debug": { tool: "bash-debug", title: "Bash Debug is not installed" },
};
export interface MissingAdapter {
+1
Переглянути файл
@@ -4127,6 +4127,7 @@
"Delve is not installed": "Delve 未安装",
"CodeLLDB is not installed": "CodeLLDB 未安装",
"PHP Debug (Xdebug) is not installed": "PHP Debug (Xdebug) 未安装",
"Bash Debug is not installed": "Bash Debug 未安装",
"{name} (child)": "{name}(子进程)",
"Enable breakpoint at {path}:{line}": "启用位于 {path}:{line} 的断点",
"Headers ({count})": "标头 ({count})",