If you don't get a scope-based answer, you can do this with more work via a regex based approach. Using an extension like Highlight which allows you to specify synatx highlighting for strings that can be captured via regular expressions. For example,
"highlight.regexes": {
"(\\b.*\\.)([^(\\s]*)(\\s*\\(.*\\))": {
"regexFlags": "g",
"filterLanguageRegex": "(java|cpp)",
\\ "filterFileRegex" : ".*\\.java",
"decorations" : [
{}, // first capture group, " do nothing
{ "color": "red",
"fontWeight": "bold",
"padding": "3px", // only pads top and bottom unfortunately
"backgroundColor": "darkgreen",
// "border": "1px solid white",
// "borderRadius": "4px"
},
{} // third capture group, ", do nothing
]
},
"((?:void|int)\\s+)([^(\\s]*)(\\s*\\(.*\\))": {
"regexFlags": "g",
"filterLanguageRegex": "(java|cpp)",
\\ "filterFileRegex" : ".*\\.java",
"decorations" : [
{}, // first capture group, " do nothing
{ "color": "red",
"fontWeight": "bold",
"padding": "3px", // only pads top and bottom unfortunately
"backgroundColor": "darkgreen",
// "border": "1px solid white",
// "borderRadius": "4px"
},
{} // third capture group, ", do nothing
]
}
The first of those captures calls like someClass.Foo("blah" , 2);
with Foo
in the second capture group.
The second of those captures calls like public void Foo(String s, int d)
with Foo
in the second capture group.
I have simplified the second regex a bit (I added only void
and int
, but you could easily add the other alternatives).
