Файли
openidea/e2e/netcoredbgPlatform.spec.ts
T
LU XIANGRUIтаwildcatDownstairs 84267f44ed fix(dotnet): explain how to get netcoredbg on Intel Macs and Windows on ARM64 (#7629)
Samsung publishes no prebuilt netcoredbg for Intel Macs or Windows on ARM64. On those platforms the tool installer offered an install that failed with "no release asset", and a .NET debug session reported only that the adapter was missing. Both now say there is no prebuilt build and how to get one (build from source, then put it on PATH or set its path in Language Servers settings); the debugger's notification opens those settings instead of retrying the launch. A netcoredbg on PATH or set in settings is still used. The release-asset check no longer treats an arm64-only macOS release as installable on an Intel Mac (only Apple silicon runs x64 builds through Rosetta).

Closes #7628

Co-authored-by: wildcatDownstairs <[email protected]>
2026-12-03 12:32:50 +08:00

79 рядки
3.3 KiB
TypeScript
Неформатований Анотація Історія

Цей файл містить неоднозначні символи Юнікоду
Цей файл містить символи Юнікоду, які можна сплутати з іншими символами. Якщо ви вважаєте, що це зроблено навмисно, можете сміливо ігнорувати це попередження. Щоб показати їх, скористайтеся кнопкою Escape.
/**
* netcoredbg on a platform Samsung publishes no build for (Intel Macs, Windows on ARM64): a failed
* debug start says how to get one and opens the settings instead of offering an install. The host is
* stubbed at the IPC layer with the backend's messages; `ide-tools` and `ide-dap` tests cover them.
*/
import { expect, ipcCalls, openFromTree, stubDesktop, test } from "./fixtures";
const SHOTS = process.env.E2E_SHOTS;
const WHY =
"Samsung publishes no prebuilt netcoredbg for Intel Macs. Build it from source (https://github.com/Samsung/netcoredbg#building-from-source-code), then put `netcoredbg` on PATH or set its executable path in Settings › Languages & Frameworks › Language Servers";
test("a missing netcoredbg with no build opens the settings and does not retry", async ({ workbench: page }) => {
await openFromTree(page, "build.gradle.kts");
await stubDesktop(page);
await page.evaluate(async (why) => {
const config = {
id: "program:app",
name: "App",
kind: "program",
command: "App.dll",
args: [],
cwd: "/dev/acme-api",
env: {},
detected: false,
isTest: false,
debugAdapter: "netcoredbg",
};
const h = window.__ipc.handlers;
h.run_configs = () => [config];
h.run_apply_settings = (args) => args.configs;
h.debug_set_breakpoints = () => [];
h.debug_start = () => {
const message = `debug adapter \`netcoredbg\` not found (\`netcoredbg\` is neither installed by OpenIDEA nor on PATH). ${why}`;
throw { kind: "unavailable", message, detail: null };
};
h.tools_list = () => [
{
name: "netcoredbg",
displayName: "netcoredbg (.NET debugger)",
kind: "debugger",
command: "netcoredbg",
languages: ["C#", "F#"],
status: "missing",
path: null,
version: null,
installMethod: "GitHub release",
canInstall: false,
unavailableReason: why,
canUninstall: false,
installHint: null,
homepage: "https://github.com/Samsung/netcoredbg",
customError: null,
defaultArgs: [],
defaultInitializationOptions: null,
alternatives: [],
companion: false,
},
];
const runModule = "/src/features/run/store.ts";
const { loadConfigs, selectConfig } = await import(/* @vite-ignore */ runModule);
await loadConfigs();
selectConfig(config.id);
}, WHY);
await page.keyboard.press("Control+d");
const toast = page.getByText("netcoredbg is not installed");
await expect(toast).toBeVisible();
await expect(page.getByText("Samsung publishes no prebuilt netcoredbg for Intel Macs.").first()).toBeVisible();
await expect(page.getByRole("button", { name: "Install and Debug" })).toBeHidden();
if (SHOTS) await page.screenshot({ path: `${SHOTS}/netcoredbg-notification.png`, animations: "disabled" });
await page.getByRole("button", { name: "Language Servers…" }).click();
const details = page.getByLabel("netcoredbg (.NET debugger) details");
await expect(details.getByRole("note")).toContainText("Build it from source");
await expect(details.getByRole("button", { name: /Install/ })).toHaveCount(0);
if (SHOTS) await page.screenshot({ path: `${SHOTS}/netcoredbg-settings.png`, animations: "disabled" });
expect(await ipcCalls(page, "debug_start")).toHaveLength(1);
});