Comments (8)
This applies the minimal changes to the edit buffer. You should be able to hit undo unless you closed the file.
But the diffs are line diffs.
It looks like expressions were repeated:
let bigRGen (n, d) =
let bigRGen (n, d) =
let bigRGen (n, d) =
let d = if d = 0 then 1 else d
let n' = abs (n) |> BigRational.FromInt
let d' = abs (d) |> BigRational.FromInt
n' / d'
I say expression, because it doesn't appear to be on a line-by-line basis
let maxInclMultipleOf =
calcMinOrMaxToMultiple true true
else
mult
...17 lines
let maxInclMultipleOf =
calcMinOrMaxToMultiple true true
else
from fantomas-for-vs.
Does your OS or editor keep intermediate copies or history? Undo in the editor?
3000 lines of work, you must have been taking snapshots??
from fantomas-for-vs.
Unfortunately, I set fantomas to format on save. And normally I do a lot of intermediate commits. Only, as bad luck has it, working on a recoding of my project putting everything in the huge script file, at almost the finish, the problem occurred. So, I am afraid, I have to do it all over.
P.S. Normally, you "save" to save your work. In this case it destroyed my work.
from fantomas-for-vs.
The least fantomas should do is check whether the formatted code is still syntactically correct. If it isn't syntactically correct do not format the code but leave it as it is. This could prevent the mess that happened to me.
from fantomas-for-vs.
A couple questions that need to be answered:
- does standalone fantomas (i.e. the fantomas dotnet tool) have the same issue
- if so, then yes this is a fantomas issue and needs to be solved there
- if not, then is the issue in this repo, inside the code that gets the fantomas response and issues edits to the editor? or is it inside the editor itself after the edit has been issued by this extension?
from fantomas-for-vs.
I tried to undo, but that didn't result in a recovery. I did this before giving up and closing the file.
from fantomas-for-vs.
@nojaf Do we check after formatting if the CodeFormatter produced a valid output?
from fantomas-for-vs.
I don't think so for Fantomas.Client
, we do this for the command line tool though.
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
- 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.