As a Roblox developer, it is currently too hard to effectively utilise the two callbacks under ScriptEditorService.
This is because, as the quoted post above shows, it is not possible to easily learn about the script’s AST table. Because of this, the callbacks can only do a few basic tasks, such as snippets. This becomes a bigger problem with the new RegisterScriptAnalysisCallback
function that was recently released.
This callback is effectively useless without any way of quickly parsing the script into usable tokens (Lexemes or AST names).
Instead, if we could derive a script’s shape from the already generated AST table, we could better learn how to parse and handle our own analysis callbacks
-- script is print("Hello World")
ScriptEditorService:RegisterScriptAnalysisCallback(function(analysis)
local document = ScriptEditorService:FindScriptDocument(analysis.Script)
print(document:GetLexemes()) --> Lexemes of shape {AstName (print), open bracket, string, close bracket}
-- also document:GetAst() maybe but idk what you'd return here
end)
If Roblox is able to address this issue, it would improve my development experience because I could learn about a script’s shape that could then be easily used in the callbacks.