When executing the scripts I'm going to pre-define certain "global variables" which can be used to script my application.
In order to provide meaningful code completion I want these variables to show up in the code completion tab as if they were defined in the parsed source files.
I tried the following to add a "system variable" to the VariableResolver but unfotunately the variable doesn't show up during auto completion.
provider = new SourceCompletionProvider( isXmlAvailable() );
VariableResolver resolver = provider.getVariableResolver();
CodeBlock block = new CodeBlock( 0 );
block.addVariable( declaration );
resolver.addSystemVariable( declaration );
I've then tried to add the completion proposal manually by doing the following:
VariableCompletion completion = new VariableCompletion( provider, "myApp", "myPkg.SomeClass" );
provider.addCompletion( completion );
But this didn't help either.
Can anybody please explain to me how I can achieve my goal?