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

Allow TS formatter to not remove extra spaces after the first non-whitespace character (and before the last). #47708

Open
Tyriar opened this issue Feb 2, 2022 · 1 comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Domain: Formatter The issue relates to the built-in formatter Suggestion An idea for TypeScript

Comments

@Tyriar
Copy link
Member

Tyriar commented Feb 2, 2022

TS Template added by @mjbvz

TypeScript Version: 4.6

Search Terms

  • format
  • formatting
  • whitespace

I often format code like this outside in other projects:

image

I've found this particularly useful when dealing with color channel in an array as it makes it much easier to see the differences in the RHS:

data[i    ] = ;
data[i + 1] = ;
data[i + 2] = ;
data[i + 3] = ;

alt+shift+f removes this whitespace, I checked settings and there are a bunch of whitespace related ones but they all seem to be strict around adding a single space. Can we add a setting so we can have these use >=1 instead space?

@mjbvz mjbvz transferred this issue from microsoft/vscode Feb 2, 2022
@mjbvz mjbvz removed their assignment Feb 2, 2022
@RyanCavanaugh RyanCavanaugh added Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript Domain: Formatter The issue relates to the built-in formatter labels Feb 2, 2022
@starball5
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Domain: Formatter The issue relates to the built-in formatter Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants