Skip to content
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

Next round of Indentation Work #257

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Dec 19, 2020

  1. Rename fsharp-statement-opens-block-p -> `fsharp-expression-opens-b…

    …lock-p`
    
    F#... doesn't have statements, which makes this name very, very confusing. This
    is a straight rename.
    Gastove committed Dec 19, 2020
    Configuration menu
    Copy the full SHA
    38b0312 View commit details
    Browse the repository at this point in the history
  2. This regex isn't used, *and* is very wrong for how strings work in F#

    This regex is a hot mess. Fortunately, it's unused.
    Gastove committed Dec 19, 2020
    Configuration menu
    Copy the full SHA
    f4fe806 View commit details
    Browse the repository at this point in the history
  3. This is A Lot, but it is, broadly, better.

    Okay. This got really messy, and I need to pin everything down.
    
    It turns out that F# indentation is _really hard_. Everything is relative, and
    the only thing that matters is that *blocks line up*. That's fine, but also
    hard. There are many cases where the "normal" behavior is to line up with a
    particular part of the preceding line, rather than with a particular indent
    level.
    
    So.
    
    This is slowly taking the approach that we should maintain a list of the levels
    of indent, and we should see:
    
    1. Ret *mostly* goes to the same level, except in certain cases when we
    might *indent*
    2. Tab will first increase indent one level, then go back to start, then
    decrease through all the preceeding levels.
    3. Indentation is for semantics, lining up blocks correctly so the compiler can
    interpret them correctly. *Formatting* should be handled by Fantomas, either via
    LSP or by calling it directly.
    Gastove committed Dec 19, 2020
    Configuration menu
    Copy the full SHA
    9e24f36 View commit details
    Browse the repository at this point in the history
  4. Hard disable electric indent mode in F# mode

    As the comment says: during testing, I'm finding that `electric-indent-inhibit`
    is not being respected. This often causes the indent-line function to fire twice
    -- which we detect and take specific action on, which means that it firing twice
    is bad. Electric Indent Mode can be disabled per-buffer, so let's just do that.
    Gastove committed Dec 19, 2020
    Configuration menu
    Copy the full SHA
    81f5e2a View commit details
    Browse the repository at this point in the history
  5. Update tests to use buttercup and get them all passing

    This marks all the tests being up-to-date using buttercup *and passing*. Huzzah!
    Gastove committed Dec 19, 2020
    Configuration menu
    Copy the full SHA
    3dda200 View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2020

  1. Try to tighten up PR a little

    Did a pass, trying to remove unused things. Did not actually find many, alas.
    Gastove committed Dec 20, 2020
    Configuration menu
    Copy the full SHA
    42ef5e5 View commit details
    Browse the repository at this point in the history