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

[Suggestion] Add whitespace setting to formatter #49

Closed
barraIhsan opened this issue Feb 19, 2021 · 2 comments · Fixed by #52
Closed

[Suggestion] Add whitespace setting to formatter #49

barraIhsan opened this issue Feb 19, 2021 · 2 comments · Fixed by #52
Assignees
Labels
enhancement new feature or request formatter code formatter issues

Comments

@barraIhsan
Copy link

So, the default one is 4 spaces. But I love to be able to change it to tabs.
Thanks

@barraIhsan barraIhsan added the enhancement new feature or request label Feb 19, 2021
@fade2gray
Copy link

Assuming you are referring to the use of 4 x space indentation when using the Format Document command from the right-click context menu or Ctrl+Shift+F - I could stand corrected but I don't think changing the method of indentation used is within the scope of the extension. See the README - https://github.com/mark-wiemer/vscode-autohotkey-plus-plus#code-format (scroll down a little).

Indentation can be toggled between spaces/tabs from the Status Bar, or from the Command Palette F1 (or Ctrl_Shift+P) and type in either tabs or spaces and choose from the drop-down menu.

@mark-wiemer
Copy link
Collaborator

mark-wiemer commented Feb 19, 2021

This is a valid issue with AHK++ (and cweijan's extension) specifically. VS Code usually allows users to format using tabs or spaces, but our formatter ignores that option and always prints out spaces. We do respect the tabSize (e.g. number of spaces to print per indentation level) option. See formattingProvider.ts:136 for implementation details, will probably be a simple fix once we find out which option corresponds to tabs vs spaces :)

@mark-wiemer mark-wiemer added this to the 2021-02 February milestone Feb 21, 2021
This was referenced Feb 21, 2021
mark-wiemer added a commit that referenced this issue Feb 21, 2021
-   Respect user choice to indent with either tabs or spaces ([#49](#49))
- Add first formatting tests
@mark-wiemer mark-wiemer added the formatter code formatter issues label Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new feature or request formatter code formatter issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants