Accessing java stubs in editor (code completion)

Hey all,

I am trying to make the code completion in the editor dynamic and I am running into several problems.

What I need is something like this:

- I have a database of houses with some properties like size and cars with properties like the horsepower.

- I need an SQL like request in the editor that goes something like this:

- Show horsepower of Audi-a8

The wanted behaviour is that if I fill in one field (either property: horsepower or entity: Audi-a8) the other field adapts the autocompletion menu and I cannot type something like:

- Show horsepower of Family-house

There has to be a dependency of the two input fields on one another.

I thought about the following solution:

I have a database in Python and I will try to access it with a java stub in MPS. The have stub has methods like getPropertiesForEntity() and for example, returns all properties of Family-house as a list. So I need to figure out how to tell my "property" Structure to envoke the getPropertiesForEntity() function in the java stub and use its returned list as the autocompletion menu.

Is this the right way to implement the dynamic behaviour? I was reading about reference scopes and behaviour in MPS but I cannot figure out how this can help me with my problem.

Happy to hear from you!

Kind Regards,

Dimi

Please sign in to leave a comment.