Skip to content

Usage and Dynamic Variables #84

@ghost

Description

I would like add Groovy auto-completion to a JavaFX text editor.
Should I use similar code with the one from this project test cases? Please let me know if you have other examples to use.

The scripts are edited in an integrated environment and during execution they receive variables via a Groovy Binding. How can I let the language server know about this binding?
Here a sample on how the scripts are executed:

final Binding binding = new Binding();
        binding.setProperty( "project", form.layout.project );
        try {
            if ( connection != null ){
                binding.setProperty( "sql", connection );
            }
            final GroovyShell shell = new GroovyShell( binding, GroovyConfiguration.CONFIG );
            final Script script = shell.parse( getText(), getId() );
            return script.run();
        } catch ( IllegalArgumentException ex ) {
            throw ex;
        } catch ( Throwable ex ){
            throwFormScriptExecutionException(dataRow, ex );
        } finally {
            binding.setProperty( "out", null );
            binding.setProperty( "sql", null );
        }
        return null;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions