MR about syntax highlighting

Pierre de Villemereuil p.dv at mailo.fr
Mon Jul 24 07:47:06 BST 2023


Hi,

> While on your branch, you will want to do
>  rebase master
> that will result in a conflict that you will have to fix, manually
> (nothing complex, I just added machine readable copyright info in the
> header).

OK, I will try to do that as soon as I have some time, probably sometime during the next two weeks.

> If you run into trouble, I can help out.

Thanks, I will poke you if I need.

> Ouch, really sorry to keep you waiting this long. 

No problem.

> - I still like most of this.

Nice to hear !

> - I'm a little undecided on the portions that look for potentially
>   locatized string ("Error", "information", but also "A
>   tibble").

Regarding "Error", that is because many functions in the tidyverse do not use the standard error output (that is alright highlighted in red in the output). So the idea here is to bring back some highlighting that would be consistent with the rest. Fortunately, and probably because it is non-standard, the error is English only (I have French error messages elsewhere, so I would know). The same goes for "A tibble" that is always in English whichever the language locale.

So, I would say it works well for now. 

If (I don't think this is planned for now) they start localising the language across their error messages, we will have the syntax highlight working only in English. So we could (i) be fine with this, (ii) catch up with all the locales keywords (but things like "tibble" should stay the same keyword across languages), or (iii) give up with those features altogether.

> - I'm somewhat concerned about the syntax definition diverging ever
>   more from the "regular" R.xml. Your MR does not really make the
>   problem worse, but eventually we should take a look into
>   synchronizing the two.

I also find it a bit weird that the syntax highlighting is so different between the source code and R terminal, and always wondering if it was by design. I can have a check sometime to bring the R terminal closer to the R source code if you want?

No sure how it would be possible to "synchronise" them however, but I'm not savvy enough to know anyway ! 😉

> - There appear to be some common rules between tibble and "normal"
>   output. Could those be factored out into a common context
>   (IncludeRules)?

You mean they are two many copy-paste in the code, right? Yes, I might have been too lazy regarding that, I'll see what I can do.

> - One thing I would like to ask you to add is an example/demo file
>   that shows off most features, so it will be easier to catch any
>   regressions when doing changes in the future.

Will do.

> I hope to be faster in the future, but I've had that hope, before...

No problem, I understand. We all have too many things to do, and too little time to do them!

Cheers,
Pierre






More information about the rkward-devel mailing list