Skip to content
Draft
53 changes: 52 additions & 1 deletion src/winapp-VSC/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,53 @@ Simply navigate to the 'Extensions' tab in VS Code, and select the option to 'In

## Features

### Workspace & Multi-Project Support

The extension supports workspaces where the app project is **not** at the root — such as monorepos, multi-app repositories, or nested project structures.

**How it works:**

When you run any WinApp command, the extension resolves the target project directory using this priority:

1. **`winapp.appDirectories` setting** — If specified in `.vscode/settings.json`, the extension uses these paths directly (no scanning). With one entry, it auto-selects; with multiple, it shows a QuickPick.
2. **Project at workspace root** — If a recognized project exists at the root, commands run there immediately.
3. **Automatic scan** — Searches the workspace for compatible projects and prompts if multiple are found.

**Configuration (optional):**

To skip automatic scanning, add the `winapp.appDirectories` setting to your workspace:

```jsonc
// .vscode/settings.json
{
"winapp.appDirectories": [
"apps/my-app",
"apps/shell"
]
}
```

| Scenario | Behavior |
|----------|----------|
| Setting has 1 entry | All commands auto-target that directory |
| Setting has multiple entries | QuickPick prompt to choose which project |
| Setting is absent or empty | Falls back to auto-detection (see below) |

**Auto-detection behavior (when setting is not configured):**

| Scenario | Behavior |
|----------|----------|
| Project at workspace root | Command runs directly — no prompt |
| No project at root, 1 project found elsewhere | Auto-selects that project |
| No project at root, multiple projects found | Shows a QuickPick list to choose which project to target |
| No projects found anywhere | Falls back to workspace root (the CLI will report an error if initialization is required) |

**Supported project types:** .NET (WPF, WinForms, WinUI 3, Console), Electron, Tauri, Flutter, Rust, and C++ (CMake).

All commands, including **WinApp: Initialize Project**, follow the same resolution logic. When no projects are found, the command falls back to the workspace root.

> **Note:** If more than 10 projects are discovered, the search stops and the QuickPick indicates that the list may be incomplete.

### Command Palette

All commands are accessible from the Command Palette (`Ctrl+Shift+P`). Type **WinApp** to see the full list.
Expand Down Expand Up @@ -121,7 +168,11 @@ The extension provides a **custom `winapp` debug type** that launches your app w

### Initialize and set up a project

Run **WinApp: Initialize Project** to configure your project with the Windows SDK and/or Windows App SDK. The command walks you through selecting an SDK channel and sets up the necessary dependencies.
Run **WinApp: Initialize Project** to configure your project with the Windows SDK and/or Windows App SDK. The command:

1. **Detects your project** — If there's a recognized app project at the workspace root, it proceeds immediately. Otherwise, it searches the workspace and presents a list of discovered projects for you to choose from.
2. **Asks for SDK channel** — Select stable, preview, experimental, or none (for projects like Rust/Tauri that bring their own SDK bindings).
3. **Runs `winapp init`** — Sets up the manifest, SDK packages, and configuration for the selected project.

### Debug with package identity

Expand Down
6 changes: 6 additions & 0 deletions src/winapp-VSC/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion src/winapp-VSC/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,20 @@
}
]
}
]
],
"configuration": {
"title": "WinApp",
"properties": {
"winapp.appDirectories": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "List of relative paths to app project directories. When specified, WinApp commands will target these directories instead of scanning the workspace. If a single directory is listed, it is used automatically. If multiple are listed, you'll be prompted to choose."
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run package",
Expand All @@ -184,6 +197,7 @@
"pretest": "npm run compile-tsc && npm run lint",
"lint": "eslint src",
"test": "vscode-test",
"test:unit": "tsc -p ./ && mocha out/test/**/*.test.js",
Comment thread
chiaramooney marked this conversation as resolved.
"clean": "node -e \"require('fs').rmSync('bin', {recursive: true, force: true}); require('fs').rmSync('out', {recursive: true, force: true}); require('fs').rmSync('dist', {recursive: true, force: true});\"",
"build-cli": "npm run build-cli-x64 && npm run build-cli-arm64",
"build-cli-x64": "dotnet publish ../winapp-CLI/WinApp.Cli/WinApp.Cli.csproj -c Release -r win-x64 --self-contained -o bin/win-x64",
Expand All @@ -204,6 +218,7 @@
"@vscode/vsce": "^3.3.2",
"esbuild": "^0.28.1",
"eslint": "^10.0.2",
"mocha": "^11.7.5",
"typescript": "^5.9.3",
"typescript-eslint": "^8.56.1"
},
Expand Down
Loading
Loading