From 9db95ea79a94f60274865d5302b44ce746e11ef9 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Wed, 11 Nov 2026 11:53:49 +0100 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFAdd=20the=20VS=20Code=20debug=20config?= =?UTF-8?q?uration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four launch entries for the server: a data folder of its own under artifacts/ (ignored by git), the demo mode, the user's real data folder, and attach to a running process. Each builds in Debug first and opens the browser once the server listens. tasks.json also exposes check, test and dev. SVILUPPO.md explains which entry to pick. Co-Authored-By: Claude Opus 5.5 --- .vscode/extensions.json | 4 +++ .vscode/launch.json | 70 +++++++++++++++++++++++++++++++++++++++++ .vscode/tasks.json | 45 ++++++++++++++++++++++++++ docs/SVILUPPO.md | 11 +++++++ 4 files changed, 130 insertions(+) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..4ba93d8 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + // The C# extension provides the "coreclr" debugger used by launch.json. + "recommendations": ["ms-dotnettools.csharp"] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..60ff966 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,70 @@ +{ + // Debugging Anubis from VS Code (needs the C# extension, ms-dotnettools.csharp). + // Each configuration builds the server in Debug first and opens the browser once it listens. + "version": "0.2.0", + "configurations": [ + { + "name": "Anubis: server, dati di prova", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build-server", + "program": "${workspaceFolder}/src/Anubis.Server/bin/Debug/net10.0/Anubis.Server.dll", + // A data folder of its own, ignored by git: the real one in %APPDATA%\Anubis stays untouched. + "args": ["--data-dir", "${workspaceFolder}/artifacts/debug-data"], + "cwd": "${workspaceFolder}/src/Anubis.Server", + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "console": "internalConsole", + "stopAtEntry": false, + "serverReadyAction": { + "action": "openExternally", + "pattern": "Now listening on: (https?://[^\\s\"]+)" + } + }, + { + "name": "Anubis: modalità dimostrativa", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build-server", + "program": "${workspaceFolder}/src/Anubis.Server/bin/Debug/net10.0/Anubis.Server.dll", + // The data of SPEC appendix F, in a folder and a database apart (the same as "tasks seed-demo"). + "args": ["--demo"], + "cwd": "${workspaceFolder}/src/Anubis.Server", + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "console": "internalConsole", + "stopAtEntry": false, + "serverReadyAction": { + "action": "openExternally", + "pattern": "Now listening on: (https?://[^\\s\"]+)" + } + }, + { + "name": "Anubis: server, dati dell'utente", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build-server", + "program": "${workspaceFolder}/src/Anubis.Server/bin/Debug/net10.0/Anubis.Server.dll", + // The desktop data folder (%APPDATA%\Anubis), the same one "tasks dev" uses. + "args": [], + "cwd": "${workspaceFolder}/src/Anubis.Server", + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "console": "internalConsole", + "stopAtEntry": false, + "serverReadyAction": { + "action": "openExternally", + "pattern": "Now listening on: (https?://[^\\s\"]+)" + } + }, + { + "name": "Anubis: aggancia a un processo", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..8995d4c --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,45 @@ +{ + // The build the debugger needs, plus the commands of tasks.ps1 (Terminal > Run Task). + "version": "2.0.0", + "tasks": [ + { + "label": "build-server", + "type": "process", + "command": "dotnet", + "args": ["build", "${workspaceFolder}/src/Anubis.Server", "-c", "Debug", "-nologo", "-consoleLoggerParameters:NoSummary"], + "group": { "kind": "build", "isDefault": true }, + "presentation": { "reveal": "silent", "clear": true }, + "problemMatcher": "$msCompile" + }, + { + "label": "check", + "type": "shell", + "command": "./tasks.ps1 check", + "windows": { "command": "./tasks.ps1 check" }, + "linux": { "command": "sh ./tasks.sh check" }, + "osx": { "command": "sh ./tasks.sh check" }, + "group": "test", + "problemMatcher": "$msCompile" + }, + { + "label": "test", + "type": "shell", + "command": "./tasks.ps1 test", + "windows": { "command": "./tasks.ps1 test" }, + "linux": { "command": "sh ./tasks.sh test" }, + "osx": { "command": "sh ./tasks.sh test" }, + "group": { "kind": "test", "isDefault": true }, + "problemMatcher": "$msCompile" + }, + { + "label": "dev", + "type": "shell", + "command": "./tasks.ps1 dev", + "windows": { "command": "./tasks.ps1 dev" }, + "linux": { "command": "sh ./tasks.sh dev" }, + "osx": { "command": "sh ./tasks.sh dev" }, + "isBackground": true, + "problemMatcher": [] + } + ] +} diff --git a/docs/SVILUPPO.md b/docs/SVILUPPO.md index 8bb0f83..38f922a 100644 --- a/docs/SVILUPPO.md +++ b/docs/SVILUPPO.md @@ -79,6 +79,17 @@ Un criterio che dipende solo da qualcosa che deve dare l'utente (chiavi dei cont Per ogni schermata: implementa, apri sui dati dimostrativi (`tasks seed-demo`), fotografa con Edge senza finestra (`msedge --headless --screenshot`) a 1440 e 390 pixel, confronta zona per zona con lo screen di `docs/design/`, correggi, ripeti finché restano differenze trascurabili. I testi fissi si leggono dalle immagini, i dati dall'appendice F, colori e misure dall'appendice C. Guarda uno screen per volta e ritaglia la zona che ti serve: le immagini sono a doppia densità. +## Debug con Visual Studio Code + +Apri la radice del repository in VS Code con l'estensione C# (`ms-dotnettools.csharp`, suggerita da `.vscode/extensions.json`), poi Esegui e debug (F5). Ogni voce compila il server in Debug (attività `build-server` di `.vscode/tasks.json`) e apre il browser quando il server ascolta: + +- **Anubis: server, dati di prova**: una cartella dati a parte, `artifacts/debug-data`, ignorata da git. Al primo avvio chiede la configurazione iniziale; per ripartire da zero basta cancellare la cartella. +- **Anubis: modalità dimostrativa**: i dati dell'appendice F, come `tasks seed-demo`. +- **Anubis: server, dati dell'utente**: la cartella vera, `%APPDATA%\Anubis`, come `tasks dev`. +- **Anubis: aggancia a un processo**: per un server già avviato, per esempio con `tasks dev`. + +Le attività `check`, `test` e `dev` sono anche in Terminale → Esegui attività. L'estensione è dell'editor, non del progetto: non entra nell'elenco dell'ADR 0004. + ## Pacchetti e consegne - **Docker**: immagine `gitea.encke-hake.ts.net/balbosoft/anubis`, pubblicata dalla CI sui tag `v*` nella sezione Packages del repository (ADR 0002). I tag `fase-N` non pubblicano nulla.