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

\t replaced by ASCII 9 on save when formatOnSave is enabled #1534

Closed
stanciuadrian opened this issue May 4, 2021 · 5 comments
Closed

\t replaced by ASCII 9 on save when formatOnSave is enabled #1534

stanciuadrian opened this issue May 4, 2021 · 5 comments

Comments

@stanciuadrian
Copy link

stanciuadrian commented May 4, 2021

Describe the bug**

Escaped tabs (\t) are replaced by ASCII 9 if formatOnSave is enabled and Save is triggered.
Fantomas [configuration] issue?

Steps to reproduce

  1. Enable Format on Save in VsCode: "editor.formatOnSave": true
  2. Add a line with escaped tabs: printfn "Hello\tWorld"
  3. Save the F# file
  4. The line becomes printfn "Hello World". A single \t is displayed as 1/2/3/4 spaces.

Expected behaviour

Escape sequences should not be replaced.

Screenshots

image

Machine info

  • OS: Windows 10 x64
  • .NET SDK version: 5.0.202
  • Ionide version: 5.5.4

Edit: rewording

@open-collective-bot
Copy link

Hey @stanciuadrian 👋,

Thank you for opening an issue. We will get back to you as
soon as we can. Also, check out our OpenCollective and consider
backing us.

https://opencollective.com/ionide

PS.: We offer backer support for all backers. Don't forget to add backer label when you start backing us 😄

@Krzysztof-Cieslak
Copy link
Member

Cc: @nojaf

@baronfel
Copy link
Contributor

baronfel commented May 4, 2021

I do think this is in fantomas. The same source code in the v4 tools shows that the formatted text includes an additional apsace after the \t character.

@nojaf
Copy link
Contributor

nojaf commented May 5, 2021

This is Fantomas' doing indeed. In short, the string was not recognized as trivia so the string from the AST was printed back out.
Please open an issue via the red button in the online tool.

@Krzysztof-Cieslak
Copy link
Member

This was fixed in Fantomas.

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

No branches or pull requests

4 participants