Skip to content

Feature Request: Option to use tabs instead of spaces when aligning property value pairs #1434

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
kborowinski opened this issue Jul 12, 2017 · 5 comments

Comments

@kborowinski
Copy link

Is it possible to add option to align property value pairs with tabs instead of spaces?

  // Align assignment statements in a hashtable or a DSC Configuration.
  "powershell.codeFormatting.alignPropertyValuePairs": true,

Currently when formatting hashtable the tabs are replaced with spaces:

image

Would love to have the option to use tabs for alignment instead:

image

@rkeithhill
Copy link
Contributor

I don't think this needs a new PowerShell setting. The code should honor the current editor.insertSpaces and editor.tabSize settings

@kborowinski
Copy link
Author

kborowinski commented Jul 12, 2017

I agree, but then it looks like the code does not honor the editor.insertSpaces setting when aligning property value pairs. I've set editor.insertSpaces to false and the property value pairs are still aligned with spaces. Is it bug then @rkeithhill ?

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

rjmholt commented Apr 7, 2020

Given

private readonly char whitespaceChar = ' ';

it looks like this rule needs to allow for configuration of the whitespace character it uses and adjust its alignment count appropriately

@bergmeister
Copy link
Collaborator

Yes, see #1055

@rjmholt
Copy link
Contributor

rjmholt commented Apr 7, 2020

Deduplicating to #1055

@rjmholt rjmholt closed this as completed Apr 7, 2020
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

5 participants