EDITED: Added support to stored scoped functions. See below.
I couldn’t find a way to submit or contribute an improvement to the Lua.tmLanguage. I tried putting it into a package, but it wouldn’t work, since Lua is a official supported language.
My contribution is related to stored functions/forward declarations. In the pristine package there is no support for this. Go to Symbol actually simply ignores this function:
local stored
stored = function() end
With this addition, the above syntax is valid:
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.function.lua</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.control.lua</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.parameters.begin.lua</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>variable.parameter.function.lua</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>punctuation.definition.parameters.end.lua</string>
</dict>
</dict>
<key>match</key>
<string>\b([a-zA-Z_]+)\s*=\s*(function)\s*(\()(^)]*)(\))</string>
<key>name</key>
<string>meta.function.lua</string>
</dict>