I'm editing GML files (GameMaker Studio) in VSCode. There's a wonderful plugin, GML Support which adds autocomplete for inbuilt GML functions and instances variables along with a bunch of other cool things.
However, VSCode doesn't seem to recognise local variables in GML (see screen grab below. Dot notation works fine)
I had a look at the VSCode's Programmatic Language Extension for variable name auto-completion but still don't get how I could register the variable declaration (i.e. var fooBar = 23;
) with VSCode's Language Server.
Ideally, I'd like the Language Server to respect variable scope for GML files:
- global variables - any
var
declarations for files underscript
folder - any local variable declarations - all
var
declarations in the surrounding{...}
What would be the easiest way to add variable name completion as described above?
Thanks in advance!
Edit: looked at vscode-python to see how registerCompletionItemProvider
(based on VSCode Language Extension doco) could be used. Unfortunately, still not clear to me as vscode-python seem to rely on Jedi to provide symbols?
So any points appreciated!