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

Strange formatting for Razor #12978

Closed
bgashler1 opened this issue Sep 29, 2016 · 1 comment
Closed

Strange formatting for Razor #12978

bgashler1 opened this issue Sep 29, 2016 · 1 comment
Assignees
Milestone

Comments

@bgashler1
Copy link
Contributor

bgashler1 commented Sep 29, 2016

  • VSCode Version: Insiders
  • OS Version: Windows 10

Regarding test item #12100

Steps to Reproduce:

  1. This may not be a problem and might just be me. Open a large .cshtml file (try the one I link to below) and select everything.
  2. Press Shift + Tab several times to collapse all the hierarchy and mess up its formatting.
  3. Now Format the file
  4. Notice that the file formats weird as pictured below (maybe it's just my file).

Original file before I used Shift+Tab several times
screen shot 2016-09-28 at 11 09 18 pm

After format
What's with the white space in the middle of the code? Maybe this file uses spaces, maybe it has mixed tabs and spaces and this had something to do with it?
screen shot 2016-09-28 at 11 08 44 pm

Notice how some of the tags that are nested are all linline still. I would expect a more opinionated format of nesting these more in a block way.
screen shot 2016-09-28 at 11 08 29 pm

Please feel free to close if it's just me :)

@bgashler1 bgashler1 added this to the September 2016 milestone Sep 29, 2016
@dbaeumer dbaeumer modified the milestones: October 2016, September 2016 Sep 29, 2016
@aeschli
Copy link
Contributor

aeschli commented Oct 11, 2016

We're using JSBeautify to format html. JSBeautify has the concept of tags that should not be formatted, as making any change to the content of these tags potentially results in differently rendered html.
This list of tags that should not be formatted is listed in the default settings and can also be changed there:
"html.format.unformatted": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, script, select, small, span, strong, sub, sup, textarea, tt, var"
But that's IMO what you see in your example.
From what I see there hasn't been any changes due to moving Razor to an extension, so this is not a regression.

@aeschli aeschli closed this as completed Oct 11, 2016
@aeschli aeschli modified the milestones: Backlog, October 2016 Oct 11, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants