-
Notifications
You must be signed in to change notification settings - Fork 10
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
Reformating on selection messes text following selection #33
Comments
Formatting a selection is a bit of a known issue for Fantomas. I think @nojaf might already be aware of this. Aside:
is an invalid comment (because of 3 slashes) in that position, because it's interpreted as an xmldoc. This might make it invisible to Fantomas in the first place. |
Hello deviousasti, First, thanks for the fast reply ! :) And I'm glad you can reproduce my problem, it's usually the first step to a fix ;) But I humbly beg to differ on the "invalid" part of the comment, on the MS website it seems clearly legit and interpreted as if I had enclosed it with summary tags, MS even seems to encourage it for quick XML summaries : Although I don't know for the other part where invalid XML comments are invisible to Fantomas. Just to mention, I had the same thought at first (that the XML doc style comment might be the reason for the bug to occur) but think I tried with a regular comment and had the same badly formatted result. I'll give it a try just to be sure. But thank you for looking into this problem, its appreciated. :) |
Hello, format selection is being reworked in fsprojects/fantomas#2272.
The F# compiler stored When stored anywhere else, you can already see a warning sign: Fantomas does restore invalid triple-slash comments, but I highly recommend that you only use them where you should. |
Hello nojaf, Thanks for the follow-up. Glad to hear you're working on it, it's a very essential tool for me! As for the comment, I see, my bad, I did not understood deviousasti's comment : it is on the placement that makes it illegal, not on the implicit XML tags, got it ! Thanks! |
Leaving this as an up-for-grabs todo item: The So, if the user selected any additional whitespace, the response will contain the range that should be replaced with the format selection result. |
Hello,
I encountered the following issue when using CTRL-K, CTRL-F (reformat selection). The text immediately following the selection gets duplicated :
example before :
after :
The code :
File encoding is UTF-8 with BOM
Visual Studio Extention version used is 1.1.0.
Thanks !
The text was updated successfully, but these errors were encountered: