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

Indentation Cleanup: First Pass #219

Merged
merged 6 commits into from
Nov 23, 2019

Conversation

Gastove
Copy link
Contributor

@Gastove Gastove commented Oct 20, 2019

This PR is part of #218

What's here?

This PR does a small set of "clean up" tasks:

  1. Perform whitespace cleanup on everything. Replaces tabs with spaces, calls indent-region on everything.
  2. Combine fsharp-mode-indent and fsharp-mode-indent-smie into a single module, fsharp-mode-structure. Update fsharp-mode accordingly.
  3. Replace indent-smie's fsharp-indent-level with indent's fsharp-indent-offset; define an alias for backwards compatibility.
  4. Moves a small number of functions out of structure into mode.

Indentation has all been done based on my own, current editor configs. If we prefer different configurations, I'm very happy to set them in a .dir-locals.el, re-run cleanup, and commit them.

All tests are passing on my machine. I've been doing some F# editing, and so far, everything seems unchanged.

Also included: I've verified that smie configs are being applied. Several are being overridden by fsharp-mode, in particular: smie tries to set indent-line-function and indent-region-function, but both are overridden. I believe this override is appropriate, as disabling it removes our ability to cycle indentation levels (which is important!). I believe this means this PR effectively also closes #68 .

Clean up tabs, indentation.
These are two modules that do tightly related things. In two separate files,
they can't cleanly share variables (`indent-smie` re-defined an indent offset
var also defined in `indent`). This commit merges them together and re-names the
variable used for offset by the `smie` configs, but does nothing else.
This commit renames `fsharp-mode-indent` and cleans up references to it. It also
scoots `fsharp-eval-phrase` next to `fsharp-eval-region` in `fsharp-mode`, where
it makes a bit more sense.

Tests are all currently passing.
@juergenhoetzel juergenhoetzel merged commit 1515793 into fsharp:master Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SMIE mode not being applied properly
2 participants