tyxml icon indicating copy to clipboard operation
tyxml copied to clipboard

IDEs and the ppx

Open Drup opened this issue 8 years ago • 6 comments

Editing html with the ppx is ... a bit annoying.

  • You don't get any fancy html handling/coloring. It would be nice to have something for that.
    • Emacs: I know it's possible to do some fancy submodes but I don't know how to do it (and how easy it would be to distribute). cc @gsg @Chris00 ?
    • Vim : I'm not even sure who to call. @rgrinberg ?
    • Others : ???
  • Indentation by ocp-indent is terrible. @AltGr, can we do something about it ?

(See here for what the syntax looks like)

Drup avatar Apr 11 '16 15:04 Drup

I am not sure what you expect for indentation. Recent ocp-indent supports ppx, and doesn't make assumptions about the contents of string quotations (i.e. they're indented as <:quot< >> used to be: if starting with a newline, indentation is completely free and preserved by ocp-indent; otherwise, it's preserved but a minimum left margin corresponding to the first non-blank character is enforced)

AltGr avatar Apr 29 '16 06:04 AltGr

it's preserved but a minimum left margin corresponding to the first non-blank character is enforced

That's the main issue. The string delimiters are placed a bit all over the place (since they are used as antiquotations..).

Consider this:

let%html my_paragraphs = {|
  <p>|}[my_span]{|</p>
  <p>more content</p>
|}

Drup avatar May 07 '16 18:05 Drup

In Tuareg, strings split on several lines are aligned with the opening {|. I am not sure what general rule you would propose. Why don't you write the above as:

let%html my_paragraphs =
  {|<p>|}[my_span]
    {|</p><p>more content</p>|}

Chris00 avatar May 07 '16 19:05 Chris00

The goal is to format the inside of the quotation like you would format html.

Drup avatar May 07 '16 19:05 Drup

@Drup so for you it would be best to follow the don't-touch rule whether the {| string starts with a newline or not ?

AltGr avatar May 11 '16 07:05 AltGr

I think it would be better yes.

Drup avatar May 11 '16 12:05 Drup