groovy.tmbundle
groovy.tmbundle copied to clipboard
Groovy syntax highlighting and quoted method names
Hi there, when using Groovy and quoted method names, it looks like two or more words at the beginning, followed by parenthesis breaks the syntax highlighting:
def "Those () or () () and neither (x) breaks a quoted method name"() {
expect: true
}
def "Word and () however breaks a quoted method name"() {
expect: true
}
I think the bug is that quoted method names are not detected as method names as at all.
See:
https://github.com/textmate/groovy.tmbundle/blob/6f903cacfb2d5397a350eeb73bc36b2c40f3da70/Syntaxes/Groovy.tmLanguage#L1380-L1382
I think it's this piece of code which detects a method declaration. If it is, then we have this ([^=]+\s+)?\w+\s*\(
regex fragment where \w+
is the piece that's supposed to be matching the method name. I am pretty sure it should be one of [a-zA-Z_]\w*
or a quoted string matcher. I just submitted a similar change for Pygments https://github.com/pygments/pygments/pull/1765 and would be happy to make one here too, but I am not sure if the project is still maintained?