Git Product home page Git Product logo

Comments (8)

deviousasti avatar deviousasti commented on May 24, 2024 1

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.

dsyme avatar dsyme commented on May 24, 2024

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.

halcwb avatar halcwb commented on May 24, 2024

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.

halcwb avatar halcwb commented on May 24, 2024

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.

baronfel avatar baronfel commented on May 24, 2024

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.

halcwb avatar halcwb commented on May 24, 2024

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.

deviousasti avatar deviousasti commented on May 24, 2024

@nojaf Do we check after formatting if the CodeFormatter produced a valid output?

from fantomas-for-vs.

nojaf avatar nojaf commented on May 24, 2024

I don't think so for Fantomas.Client, we do this for the command line tool though.

from fantomas-for-vs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.