Comments (5)
Formatting a selection is a bit of a known issue for Fantomas.
This is the output I get back from Fantomas LSP:
I think @nojaf might already be aware of this.
Aside:
/// Fantomas-for-vs does works well with CTRL-K CTRL-F
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.
from fantomas-for-vs.
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. :)
from fantomas-for-vs.
Hello, format selection is being reworked in fsprojects/fantomas#2272.
This might solve your problem, it might not.
For now, Fantomas works best on the entire file.
But I humbly beg to differ on the "invalid" part of the comment,
The F# compiler stored ///
comments in certain locations.
For example, when placed above a function, it will be part of the AST node of said function.
When stored anywhere else, you can already see a warning sign:
It is subtle but there are dots at the start here. In future versions of the compiler, you will receive warnings when you use triple-slash where you shouldn't.
Fantomas does restore invalid triple-slash comments, but I highly recommend that you only use them where you should.
from fantomas-for-vs.
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!
from fantomas-for-vs.
Leaving this as an up-for-grabs todo item:
https://www.nuget.org/packages/Fantomas.Client/0.6.0 was released. This contains a change in the selection API.
The FantomasResponse
now exposes the range of the selection that was formatted.
So, if the user selected any additional whitespace, the response will contain the range that should be replaced with the format selection result.
from fantomas-for-vs.
Related Issues (20)
- Move to fsprojects/fantomas-for-vs? HOT 5
- Microsoft.VisualStudio.Shell.15.0 not found when loading extension HOT 8
- Missing Options: Fantomas Visual Studio 2022 Community Options Menu HOT 3
- Formatting doesn't work with WSL2 hosted files in VS2022 HOT 31
- Fantomas' package name changed from `fantomas-tool` to `fantomas` HOT 3
- Fantomas does not work in Visual Studio 2022 HOT 6
- Fantomas scrambled up a huge script file HOT 8
- Inconsistent version numbers
- Settings page looks different from screenshot and is missing many options HOT 2
- Broken "read the documentation" link HOT 2
- Enable or disable "Format on save" per repo
- The extension stopped working after upgrading Visual Studio 2022 to the latest version 17.4 HOT 2
- Unable to install the extension to VS 2022 on ARM64 HOT 2
- Extension does not load when a folder is opened in VS instead of a solution HOT 1
- Fantomas < 5.0 breaks nested lists HOT 16
- fsharp_multiline_bracket_style setting is not applied HOT 9
- Error in format files inside Visual Studio after updating fantomas to 6.0.0-alpha-010 HOT 7
- [Live buffers] Extension does not work with the new live buffers HOT 3
- Error: "Creating the Fantomas Deamon failed" when saving a file or trying to format in VS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fantomas-for-vs.