Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAUI templates should respect tabs/spaces preferences like other templates #13782

Closed
BretJohnson opened this issue Mar 9, 2023 · 2 comments · Fixed by #14215
Closed

MAUI templates should respect tabs/spaces preferences like other templates #13782

BretJohnson opened this issue Mar 9, 2023 · 2 comments · Fixed by #14215
Labels
area-templates Project templates, Item Templates for Blazor and MAUI fixed-in-7.0.92 Look for this fix in 7.0.92! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 t/enhancement ☀️ New feature or request

Comments

@BretJohnson
Copy link
Member

Description

When creating a new MAUI app or adding a page, based on the MAUI app/item template, it should uses spaces instead of tabs if the VS editor preferences are set to use spaces (which is the default, I believe). Other templates seem to do this.

Steps to Reproduce

  1. In VS, go to Tools/Options/Text Editor/C#/Tabs and ensure that the preference is set to use spaces (the default, believe)
  2. Do File / New Project / MAUI App. Note that it uses tabs. Expected: Should respect editor preference, spaces here.

For comparison, do File / New Project ASP.NET Core Web App, switching the VS IDE options between tabs and spaces.
Note that it adjusts dynamically, respecting the formatting preference. Formatting preferences like indent = 8 with spaces are respected too.

I'm not sure how the other templates achieve this, but hopefully there's some easy, built in mechanism to make it work.

Link to public reproduction project repository

n/a

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS, Other (Tizen, Linux, etc. not supported by Microsoft directly)

Affected platform versions

all

Did you find any workaround?

Workaround: manually reformat.

Relevant log output

No response

@BretJohnson BretJohnson added the t/bug Something isn't working label Mar 9, 2023
@BretJohnson BretJohnson changed the title MAUI app template should respect tabs/spaces preferences like other templates MAUI templates should respect tabs/spaces preferences like other templates Mar 9, 2023
@jsuarezruiz jsuarezruiz added the area-templates Project templates, Item Templates for Blazor and MAUI label Mar 9, 2023
@mattleibow mattleibow added t/enhancement ☀️ New feature or request and removed t/bug Something isn't working labels Mar 9, 2023
@mattleibow mattleibow added this to the Backlog milestone Mar 9, 2023
@ghost
Copy link

ghost commented Mar 9, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@BretJohnson
Copy link
Member Author

BretJohnson commented Mar 9, 2023

I pinged Phil Henning to better understand the cause / fix here. And he said this is an issue with solution templates (which are rare) but not with project templates (much more common). Switching the MAUI app template to a project template would fix it, which is something Phil suggested before since it doesn't need to be a solution template (just has a single project) and is more like other templates. See below for changes to do that.

So that's probably a good idea for the MAUI app template (though we'd need to test). For the Blazor template and other templates with multiple projects, we'd have to keep them as solution.

the changes to the template.json would be pretty simple, just change the type and add a projectOutput with a condition for  the sln file so that it only gets written for CLI, similar to blazor: (without the Hosted condition though) https://github.com/dotnet/aspnetcore/blob/9c7db555f5c8b7069347b9c62976bd951afba4a0/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/.template.config/template.json#L31

@samhouts samhouts added the fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! label Apr 12, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 12, 2023
@samhouts samhouts modified the milestones: Backlog, .NET 8 May 24, 2023
@samhouts samhouts modified the milestones: .NET 8, .NET 7 + Servicing Jul 10, 2023
@samhouts samhouts added the fixed-in-7.0.92 Look for this fix in 7.0.92! label Jul 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-templates Project templates, Item Templates for Blazor and MAUI fixed-in-7.0.92 Look for this fix in 7.0.92! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 t/enhancement ☀️ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants