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 if literal string include comment like strings #32

Closed MarkSymsCtx closed 7 years ago

MarkSymsCtx commented 7 years ago

If there are literal string in the Groovy script that look like comments then the syntax highlighting goes wrong.

e.g

"https://myartifactoryserver.company.net/api/copy/" or "pattern": "${src}/*",

In the first example the syntax highlighting switches to comment at the // and runs until some higher level terminator triggers and in the second it switches to comment mode at the / and run until it sees a / i.e. the end of a later comment.

This not only makes things hard to read but also upsets the indentation system as well.

Wilfred commented 7 years ago

I can't reproduce this. Could you provide a full code snippet that shows this behaviour?

MarkSymsCtx commented 7 years ago

Here you go, it's being seen in a method that builds a JSON upload spec for Artifactory (on my machine it goes very obviously wrong at "${src}/*" but looking at it in more detail I think it starts going wrong at "files" -

def upload(env, buildinfo, server, flat, src, dst) { def uploadSpec = """{ "files": [ { "regexp": "false", "flat": "${flat}", "pattern": "${src}/*", "target": "${dst}/" } ] }"""

... }

Wilfred commented 7 years ago

OK, this is a duplicate of #29 by the looks. The problem is the """.

MarkSymsCtx commented 7 years ago

Looks like it yes.

russel commented 7 years ago

I am closing this as a duplicate of #29.