I fixed this for myself with this change:
variable:
- match: '{{identifier}}{{function_assignment_ahead}}'
scope: entity.name.function.lua
pop: true
- match: '{{identifier}}{{function_call_ahead}}'
scope: variable.function.lua
pop: true
- match: '{{identifier}}'
scope: meta.property.lua
pop: true
The scope in the third item is by default variable.other.lua. This way most text is defaulted to the normal color, and actual function names are much more easily distinguished (behavior is also more similar to the LuaExtended).
I agree with your assessment that coloring everything in the file, especially all variables, produces very colorful code and means you likely end up having no white text at all (which is why I modfified my color scheme not to do that).
However, from a syntax definition perspective it is correct to scope all variables as, well, variable and it's the color scheme's job to decide whether to colorize that or not. There is ongoing discussion in https://github.com/sublimehq/Packages/issues/1842#issuecomment-464938573 for example where we are trying to find a general solution that can be applied to most or all syntaxes that will also support color scheme authors with their decisions.
Hm, maybe the issue for me then isn't that everything is colored as a variable, but rather that there isn't a separate scope for table entries which are also functions. I tried changing my variable color to white, but it was a lot harder to read the highlighting when functions weren't highlighted. I'm not sure which scope is which but could "variable" functions be colored the same as built-in functions? Or alternatively is there another available scope that could be used to separate variables-that-are-functions from variables-that-aren't-functions for Lua?
For reference, here is a screenshot of code highlighted how I want it to look. Here is that same snippet with everything as a variable, and finally here is variables highlighted white. IMO the first one is obviously the most "correct" way to have functions distinguished from things that aren't functions.
As an aside, I use ST as my Lua IDE because I work on wikis, and the Mediawiker package is unparalleled in utility for this purpose. Maybe include Scribunto's libraries as defaults? I'm not sure how widespread this use is though
function h.makeTogglerButtons(togglers, n)
local tbl = {}
tbl[1] = h.makeToggler(n, 1)
for i, _ in ipairs(togglers) do
if i == #togglers then
tbl[ftb1+1] = h.makeLastToggler(n)
else
-- first add 1 because we already did 1 from the default bracket
tbl[#tbl+1] = h.makeToggler(n, i + 1)
end
end
return tbl
end
My slightly-tweaked Mariana looks kind of like your desired output:

I think you need to modify your color scheme to set variable to white and then variable.function back to pink, or use variable.other for the white rule.
Oh thanks! I didn't realize that was possible. Yeah, this is fine as-is then.
Most helpful comment
Oh thanks! I didn't realize that was possible. Yeah, this is fine as-is then.