Skip to content

Tabs indentation is handled incorrectly #1441

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

Closed
Stanvy opened this issue Apr 11, 2020 · 4 comments
Closed

Tabs indentation is handled incorrectly #1441

Stanvy opened this issue Apr 11, 2020 · 4 comments

Comments

@Stanvy
Copy link

Stanvy commented Apr 11, 2020

Issue Type: Bug

For Alman code formatting style, tabs indentation is handled incorrectly.
For example, the following code will have one space character in front of open brackets and "else" statement instead of tab:

while ($a) {
	if ($b) {
		$c = 1
	} else {
		$d = 2
	}
}

Extension version: 2020.3.0
VS Code version: Code 1.43.2 (0ba0ca52957102ca3527cf479571617f0de6ed50, 2020-03-24T07:38:38.248Z)
OS version: Windows_NT x64 10.0.18363

@SydneyhSmith SydneyhSmith transferred this issue from PowerShell/vscode-powershell Apr 14, 2020
@ghost ghost added the Needs: Triage 🔍 label Apr 14, 2020
@SydneyhSmith
Copy link
Collaborator

@Stanvy thanks for opening this issue, looks like your issue is the same as #1055 can you confirm if this is what you are experiencing?

@Stanvy
Copy link
Author

Stanvy commented Apr 21, 2020

In my opinion it's a different issue.

So, back to provided example...

Input:

while ($a) {
	if ($b) {
		$c = 1
	} else {
		$d = 2
	}
}

Output:

1. while ($a)
2. {
3. 	if ($b)
4.  {
5. 		$c = 1
6. 	}
7.  else
8.  {
9. 		$d = 2
10. 	}
11. }

Expected:

1. while ($a)
2. {
3. 	if ($b)
4. 	{
5. 		$c = 1
6. 	}
7. 	else
8. 	{
9. 		$d = 2
10. 	}
11. }

So in the "Output" string lines 4, 7 and 8 start with space, but should be with tab.

@bergmeister
Copy link
Collaborator

@Stanvy PSSA has never had complete support for tabs generally speaking. Although the UseConsistentIndentation rule has an option for using tabs instead of spaces, most of the rules rules do not have similar options and just have spaces hardcoded:

@Stanvy
Copy link
Author

Stanvy commented May 1, 2020

I would say more as personal preference that I used to throughout the years.

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

No branches or pull requests

3 participants