Groovy-Emacs-Modes / groovy-emacs-modes

A groovy major mode, grails minor mode, and a groovy inferior mode.
84 stars 39 forks source link

Incorrect highlighting of keyword arguments without parentheses #26

Closed Wilfred closed 7 years ago

Wilfred commented 8 years ago

If I call a function with keyword arguments, but without parentheses (common in Jenkinsfile scripts):

foo x: 1, y: 2

The x is incorrectly highlighted with font-lock-type-face.

groovy_highlight

It's not clear to me which part of the syntax is doing this -- any pointers?

russel commented 8 years ago

This syntax is not something available in C, C++, Java or Awk, so all the standard "parsing" the Groovy mode is based on will misinterpret this construct. Fixing this will almost certainly necessitate reworking function call especially for Groovy.

Wilfred commented 7 years ago

@russel how attached are you to basing groovy-mode on c-mode? Would you accept a PR that changed it to be a standalone mode?

russel commented 7 years ago

@Wilfred I am not at all attached to CC Mode, at least per se. Back in the early days there were two modes, one an adaption of Ruby Mode and this one. This one got more attention and so become the de facto standard. This Groovy Mode is based on CC Mode because of the Java and Awk stuff. You got a lot of functionality etc. for very little work. However, there are problems, some likely insoluble because of the CC Mode base. Removing the CC Mode will require a lot of work to replace all the stuff that it provides. However doing that will likely allow for solutions to the currently insoluble.

I would suggest the best way forward would be to create a parallel mode either here or in a separate repository and see how it goes. If the mode not based on CC Mode begins to look like the way forward, we can then look to swap it in for what we have now.

Does this seem reasonable?

Wilfred commented 7 years ago

Yep, that sounds reasonable. Thanks for the feedback. I'll put something together and we'll see how it goes :)

russel commented 7 years ago

We have changed the Groovy mode from being a CC-Mode derived one to being a standalone one. We are therefore closing all issues relating to the old mode. If you try the new mode and see any problems please post a new issue.