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

auto indentation bug #211

Open
Tracked by #218
laynor opened this issue Jul 20, 2019 · 2 comments
Open
Tracked by #218

auto indentation bug #211

laynor opened this issue Jul 20, 2019 · 2 comments

Comments

@laynor
Copy link

laynor commented Jul 20, 2019

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
@laynor
Copy link
Author

laynor commented Jul 23, 2019

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.

@juergenhoetzel
Copy link
Collaborator

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.

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

No branches or pull requests

2 participants