emacs-fsharp-mode
emacs-fsharp-mode copied to clipboard
auto indentation bug
Description
I cannot get fsharp-mode to correctly indent nested arrays
Repro steps
Try to type something like
[
[
12
13
]
]
Expected behavior
Would expect the TAB key to propose the correct indentation for the integer values.
Actual behavior
The cursor can only move to the beginning of line or at the first tab stop, with these results:
[
[
12
13
]
]
Known workarounds
manually indent the first array element
Related information
- Operating system Arch linux
- Branch Installed from melpa
- Emacs version 27.0.50
- .NET Runtime, CoreCLR or Mono Version netcore 3.0.0 preview
commenting out some lines in fsharp-compute-indentation seems to solve this issue:
At line 505:
(goto-char open-bracket-pos)
;; (setq placeholder (point))
;; (fsharp-goto-initial-line)
;; (fsharp-goto-beginning-of-tqs
;; (save-excursion (nth 3 (parse-partial-sexp
;; placeholder (point)))))
(+ (current-indentation) fsharp-indent-offset))))
However, I do not know if this change breaks something else.
Thanks for report. I have to investigate this later: I'm about to port fsharp mode to lsp. I hope we can use textDocument/rangeFormatting in the near future.