mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-06 08:07:49 +00:00
fix(debugger): offer to install php-debug when it is missing (#1633)
php-debug had no entry in the missing-adapter table, so a PHP debug session without it failed with a plain error pointing at mason.nvim. It now offers Install and Debug like debugpy, Delve or js-debug, and the hint points to Settings › Languages & Frameworks › Language Servers. Co-authored-by: Inf1mum <8135225+Inf1mum@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -29,4 +29,4 @@ install-hint = "Install phpactor (https://phpactor.readthedocs.io/en/master/usag
|
||||
[debugger]
|
||||
adapter = "php-debug"
|
||||
command = "php-debug-adapter"
|
||||
install-hint = "Install vscode-php-debug (Xdebug) as `php-debug-adapter` (e.g. via mason.nvim) and enable Xdebug"
|
||||
install-hint = "Install PHP Debug (Xdebug) in Settings › Languages & Frameworks › Language Servers, and enable Xdebug"
|
||||
|
||||
@@ -27,6 +27,17 @@ describe("missing debug adapters", () => {
|
||||
expect(missingAdapter("delve", unavailable("debug adapter `delve` not found (x)"))?.tool).toBe("delve");
|
||||
});
|
||||
|
||||
it("offers the managed install of the missing php-debug adapter", () => {
|
||||
const e = unavailable(
|
||||
"debug adapter `php-debug` not found (`php-debug-adapter` is neither installed by OpenIDEA nor on PATH). Install PHP Debug (Xdebug) in Settings › Languages & Frameworks › Language Servers, and enable Xdebug",
|
||||
);
|
||||
expect(missingAdapter("php-debug", e)).toMatchObject({
|
||||
tool: "php-debug",
|
||||
title: "PHP Debug (Xdebug) is not installed",
|
||||
body: e.message,
|
||||
});
|
||||
});
|
||||
|
||||
it("leaves other failures and adapters without an installer alone", () => {
|
||||
expect(missingAdapter("js-debug", unavailable("connection refused"))).toBeNull();
|
||||
expect(missingAdapter("js-debug", new Error("debug adapter `js-debug` not found"))).toBeNull();
|
||||
|
||||
@@ -12,6 +12,7 @@ const INSTALLABLE: Record<string, { tool: string; title: string }> = {
|
||||
"js-debug": { tool: "js-debug", title: "The JavaScript debugger (vscode-js-debug) is not installed" },
|
||||
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" },
|
||||
};
|
||||
|
||||
export interface MissingAdapter {
|
||||
|
||||
@@ -4123,6 +4123,7 @@
|
||||
"The JavaScript debugger (vscode-js-debug) is not installed": "JavaScript 调试器 (vscode-js-debug) 未安装",
|
||||
"Delve is not installed": "Delve 未安装",
|
||||
"CodeLLDB is not installed": "CodeLLDB 未安装",
|
||||
"PHP Debug (Xdebug) is not installed": "PHP Debug (Xdebug) 未安装",
|
||||
"{name} (child)": "{name}(子进程)",
|
||||
"Enable breakpoint at {path}:{line}": "启用位于 {path}:{line} 的断点",
|
||||
"Headers ({count})": "标头 ({count})",
|
||||
|
||||
Reference in New Issue
Block a user