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

Incorrect highlighting of keyword arguments without parentheses #26

Closed
Wilfred opened this issue Sep 16, 2016 · 5 comments
Closed

Incorrect highlighting of keyword arguments without parentheses #26

Wilfred opened this issue Sep 16, 2016 · 5 comments
Labels

Comments

@Wilfred
Copy link
Contributor

Wilfred commented Sep 16, 2016

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
Copy link
Contributor

russel commented Oct 15, 2016

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
Copy link
Contributor Author

Wilfred commented Mar 1, 2017

@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
Copy link
Contributor

russel commented Mar 1, 2017

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

Wilfred commented Mar 1, 2017

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

Wilfred added a commit to Wilfred/groovy-emacs-modes that referenced this issue Mar 6, 2017
* Ensures we highlight all keywords correctly. Fixes Groovy-Emacs-Modes#33 and Groovy-Emacs-Modes#26. We
  also highlight `println` and `print` for consistency with other
  modes, such as python-mode.

* Highlight triple-quoted strings correctly. Fixes Groovy-Emacs-Modes#29.

* Ensure we consistently highlight variable declarations (fixes Groovy-Emacs-Modes#27)
  and variable assignments.

* Highlights `it` as a variable unconditionally.
Wilfred added a commit to Wilfred/groovy-emacs-modes that referenced this issue Mar 6, 2017
* Ensures we highlight all keywords correctly. Fixes Groovy-Emacs-Modes#33 and Groovy-Emacs-Modes#26. We
  also highlight `println` and `print` for consistency with other
  modes, such as python-mode.

* Highlight triple-quoted strings correctly. Fixes Groovy-Emacs-Modes#29.

* Ensure we consistently highlight variable declarations (fixes Groovy-Emacs-Modes#27)
  and variable assignments.

* Highlights `it` as a variable unconditionally.
@russel
Copy link
Contributor

russel commented May 16, 2017

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.

@russel russel closed this as completed May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants