Comments (15)
Dear @davidspiess and @kodfodrasz
I've shipped a better diff model which is line-ending agnostic, and also results in smaller diffs.
Could you please update (to 0.8.3) and let me know how it works now (with Apply As Diff
turned on)?
from fantomas-for-vs.
Ah, so that's definitely the suspect. It should really be line-ending agnostic - I'm currently using the Diffplex library.
Issue #13 is also related to the diffing library. Maybe it's time to try some alternatives.
I'll try to work on a fix soon, so in the mean time could you please adjust with the diff turned off?
from fantomas-for-vs.
I can see where it breaks - that's a good repro.
P.S.
If you're trying advent of code, I'd like to recommend F# Worksheet.
https://github.com/deviousasti/fsharp-worksheet
It makes exploratory coding fairly fun.
from fantomas-for-vs.
Just pushed 0.8.4 which shrinks the diff before applying to the edit buffer, hopefully fixing #13.
Thanks for the report!
from fantomas-for-vs.
Hi Gábor,
First off, thank you for providing such a detailed report.
We can rule out a number of cases just based on that.
I'm not able to reproduce the problem, unfortunately.
I'm on VS 16.9 Preview 4.
Could you try toggling the formatter version - if it's Latest, it's on 4.4.0 beta 8
and Stable it's on 4.3.0
.
from fantomas-for-vs.
Hi!
I have ran sfc /scannow
, and Repair on the Visual Studio installation from the Visual Studio Installer, just in case. Reinstalled the extension afterwards.
I have tried both Stable and Latest versions. Both exhibit the same erroneous behavior.
I have updated fantomas to latest stable version (4.4.0), and it still does not exhibit problematic behavior, it formats the files as expected.
from fantomas-for-vs.
After having poked around the options the "Apply As Diff" option seems to be the problematic part. When disabling it the formatter works as expected. (albeit whole file is marked as changed).
I'm using UNIX file endings in many projects. Maybe that can be the cause of some offset problems when calculating the diff?
from fantomas-for-vs.
Yikes, that sounds pretty off.
Could you try downloading this and try formatting it?
https://www.dropbox.com/s/59iapleqviuo8r8/Program.fsx?dl=1
This is CRLF and UTF-8 BOM.
Another thing you can do is try to set Apply As Diff
to False.
from fantomas-for-vs.
For now I have set Apply As Diff
to false, as the tool working from the IDE instead of running fantomas manually from the cli is worth way more for me than the correctly colored margins on VS editor. 🙂
When reenabling the Apply As Diff
the example file is properly formatted.
The following file (the original I extracted the repro example, but in verbatim binary copy) is still incorrectly formatted:
http://files.kodfodrasz.net/Day7.fs
This is UTF-8 NO-BOM, LF
line endings.
from fantomas-for-vs.
Same problem as @kodfodrasz. Disabling Apply As Diff
fixed it for me too!
from fantomas-for-vs.
@davidspiess The same Unix line-endings as well?
from fantomas-for-vs.
@deviousasti yes, this is my editorconfig:
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
from fantomas-for-vs.
@deviousasti it formats correctly, thank you!
from fantomas-for-vs.
I have just tired it. The previously problematic file was formatted perfectly. Will test it further in the next days, but for the glimpse it seems like the problem is solved!
Thank you very much!
from fantomas-for-vs.
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
- Reformating on selection messes text following selection HOT 5
- 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.