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

Midline tabs inserted before comment #392

Open
breyed opened this issue May 16, 2024 · 1 comment
Open

Midline tabs inserted before comment #392

breyed opened this issue May 16, 2024 · 1 comment

Comments

@breyed
Copy link

breyed commented May 16, 2024

Description
When an XML file has a comment after an element on the same line, the formatter adds tabs before the comment.

Repro:

  1. Set editorconfig to use tabs for indenting.
  2. Create an XML file with the “before formatting” content below.
  3. Format.

Notice that it results in the “after formatting” content, which has 2 tabs before the comment. It appears that the formatter is applying the 2 tabs necessary for a line indent at this level to an in-line comment case. It’s good that the comment is being kept on the same line, but the tabs should not be inserted.

Screenshots
Before formatting:

<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
	<PropertyGroup>
		<TrimMode>full</TrimMode><!-- Comment -->
	</PropertyGroup>
</Project>

After formatting:

<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
	<PropertyGroup>
		<TrimMode>full</TrimMode>		<!-- Comment -->
	</PropertyGroup>
</Project>

Extension Version
2.5.1

VS Code Version
1.89.1

Operating System
macOS 14.4.1

@text-dev
Copy link

text-dev commented Feb 7, 2025

Any news on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants