Xtext-enabled TextArea [message #1080744] |
Tue, 06 August 2013 06:31  |
Eclipse User |
|
|
|
Hi All,
I have a usecase where I will be providing my dsl in a textarea(SWT Text control) embedded into an Editor in my eclipse plug-in. I want to use Xtext's feature of Syntax Highlighting, validation, code completion etc.
Is there a way to do this ?
Regards,
Priya
|
|
|
|
|
|
|
|
|
|
Re: Xtext-enabled TextArea [message #1081814 is a reply to message #1081653] |
Wed, 07 August 2013 14:30   |
Eclipse User |
|
|
|
Hi Christian,
I got the code pointed by you. There were some errors, when I tried to 'Generate Xtext Artifacts', the import rule was conflicting with some other rule. Then I changes the multiplicity of import from * to + , then it compiled fine.
Now I wonder, what the code is doing. I saw the example project, it has three dsl files. Can you please explain a little what the behavior is ? How should I know what the project is providing ?
When I open the .mql dsl, it has some methods and all, but my requirement is how can I make an swt textarea to be xtext-enabled ? I mean instead of using editor provided by xtext, I will enter my language into the textarea and the textare should provide me all the editor functionality(like syntax checking, code completion etc...). Is your project doing this ? If yes, could you please tell me the steps- how to test/use the functionality written into the plug-in ?
Regards,
Priya
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Xtext-enabled TextArea [message #1086519 is a reply to message #1086508] |
Wed, 14 August 2013 05:48  |
Eclipse User |
|
|
|
P.S: are you sure it dosent work with
public class ModelQueryLanguageEditedResourceProvider implements IEditedResourceProvider {
@Inject
IResourceSetProvider rsp;
private IProject project;
public IProject getProject() {
return project;
}
public void setProject(IProject project) {
this.project = project;
}
public XtextResource createResource() {
return (XtextResource) rsp.get(project).createResource(URI.createURI("test.mql"));
}
}
simply call setProject on the ModelQueryLanguageEditedResourceProvider
you pass to the embeddedEditorFactory
|
|
|
Powered by
FUDForum. Page generated in 0.06341 seconds