Commit 6436336
[Microsoft.Android.Templates] New files should open editor (#8623)
Fixes: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1918037
Context: https://github.com/dotnet/templating/wiki/Reference-for-template.json
Context: https://github.com/dotnet/templating/wiki/Post-Action-Registry#open-a-file-in-the-editor
Within Visual Studio, if you:
1. Create a new .NET MAUI or .NET Android app, then
2. Go to the Solution Explorer, then
3. Right-click a folder, then click Add > New Item > Android, then
4. Double-click the **Android Activity** template.
The expected result is that a new Android Activity based on the
Android Activity template will be added to your solution
*and opened in the editor*.
Instead, a new Android Activity is added, but it is *not* opened.
Update the `.template.config/template.json` files to contain a
`postActions` section with a `openInEditor` id. This *should* cause
Visual Studio to open the new files within the editor.1 parent 2675256 commit 6436336
File tree
2 files changed
+28
-2
lines changed- src/Microsoft.Android.Templates
- android-activity/.template.config
- android-layout/.template.config
2 files changed
+28
-2
lines changedLines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
25 | 38 | | |
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
18 | 31 | | |
0 commit comments