tuareg icon indicating copy to clipboard operation
tuareg copied to clipboard

OCaml keywords as extension names confuses indentation

Open jtoman opened this issue 5 years ago • 2 comments

If the name of an extension node is an OCaml keyword, the indentation mode gets extremely confused. I have observed this in at least two scenarios. Once when trying to add a monadic do block as in:

begin%do
 ...
end

In another example, using the ppxlib.metaquot functionality and the type extension deeply confuses Tuareg, e.g.

match x with
| [%type: int] -> ...

jtoman avatar Dec 27 '19 09:12 jtoman

I understand for the first (and it is not related to the fact that it is %do) but the second is indented as

let _ =
  match x with
  | [%type: int] -> x
  | u -> v

which looks fine to me.

Chris00 avatar Dec 30 '19 10:12 Chris00

Interesting, in my version of Tuareg, I get the following indentation:

let x =
  match x with
  | [%type: int] -> assert false
               | u -> u

According to Emacs, I'm using the most recent version available from Melpa, would something have changed since the last reason to explain this?

jtoman avatar Jan 07 '20 09:01 jtoman