Referencing Java Types From A Manually Linked Grammar? [message #1099055] |
Sun, 01 September 2013 03:57 |
Chris Ainsley Messages: 78 Registered: March 2010 Location: UK |
Member |
|
|
I have a grammar which I am manually linking due to values that can be placed in certain locations being heavily dynamic. Each field has a series of metadata which I maintain externally. One of the metadata fields is a hint as to the type of validations to perform on a field. This is working well.
As this is entirely dynamic, I use a single terminal rule for almost all types which captures a string with the appropriate escaping rules implemented. I now wish to add a new validation and content assist for Java Types.
So far, I have included the following line in my XText file:
import "platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.ecore" as types
I do not use the following type (because I only have one type, that of String, and the rest is handled by my custom validator):
types::JvmIdentifiableElement
So my two questions are:
- Now that my content proposal provide extends AbstractJavaBasedContentProposalProvider, how do I wire up my concrete proposal provider to show the Java Types list as and when I required it?
- How do I validate that a given string is a valid java class (or even better, a valid java class with a public constructor) in my validator class?
I hope this makes sense.
|
|
|
Powered by
FUDForum. Page generated in 0.02733 seconds