Add types to auto-completion [message #1100661] |
Tue, 03 September 2013 12:14 |
Aurélien Lebeau Messages: 16 Registered: September 2013 |
Junior Member |
|
|
Hi,
I am enhancing a RCP with Xtext and I would like to add values to default ones provided by cross-referencing and auto-completion. The problem is that these values, either types or variables, are defined in a SQL database that is handled in an another plugin.
For now, the cross-referencing looks like this and works great for variables declared in the same file.
variable: variable=[var_declaration|IDENTIFIER]
I know it's possible to refer to JVMTypes using these lines but it's not sufficient for what I want.
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as jvmTypes
[jvmTypes::JvmType | IDENTIFIER]
How can I start ? ResourceProvider, Scope or anything else ? I should get values from DB, then including them in the xtext resources.
Is it possible to get a solution that is constantly refreshing references from database ? In other words, the database can be modified at any moment and I must have the latests values, so each time cross-reference is made, the values should be refreshed.
Thanks in advance !
|
|
|
|
Re: Add types to auto-completion [message #1100910 is a reply to message #1100909] |
Tue, 03 September 2013 19:41 |
|
hmmm looks like i got you wrong.
so you want to reference to something that is not really there right?
so the first question is: do you need references at all or are validated and proposed values ok? if so simply hook into validator and proposalprovider.
if not you need to make the stuff available somehow. e.g. by a special resource service provider.
maybe IDerivedStateComputer is a possible hook too.
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Tue, 03 September 2013 19:52] Report message to a moderator
|
|
|
|
Re: Add types to auto-completion [message #1101224 is a reply to message #1100661] |
Wed, 04 September 2013 06:57 |
Aurélien Lebeau Messages: 16 Registered: September 2013 |
Junior Member |
|
|
Thanks for your responses.
Ideally, I would like something like the jvm types but for now, it would be ok if I only have them proposed and validated.
So if I got it right, for the rules where I need cross-reference to these DB-values, I do not need to make cross-references like but I can let only and then modify the validator and the proposal provider ?
Is it also possible to redefine the behaviour of ctrl-clic ? Actually, I display the variables and types (from DB) in a panel of my RCP. It would be great if when I ctrl-clic on a variable in my DSL file, the corresponding one is selected in my panel. I already have all the mechanism to select a variable given its name.
[Updated on: Wed, 04 September 2013 07:48] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03073 seconds