|
|
|
|
|
|
|
|
Re: Xtext-enabled TextArea [message #1081814 is a reply to message #1081653] |
Wed, 07 August 2013 18:30 |
Priya Sabut Messages: 41 Registered: September 2012 |
Member |
|
|
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 #1086483 is a reply to message #1080744] |
Wed, 14 August 2013 09:04 |
Priya Sabut Messages: 41 Registered: September 2012 |
Member |
|
|
Hi Christian,
I am able to create my own view(xtext-enabled) the same way it was done in your code.
Inside my grammar I am using FullJvmFormalParameter and JvmTypeReference types for my function argument and return types resp. For below method definition(language), the editor is not showing any error
function getXC(String xc): String {
return xc;
}
function getName(String a, java.util.ArrayList s)
: String {
if(a.equals('A')){
return a
}
else return "";
}
But I am getting error markers when I write the function inside my view "Couldn't resolve reference to JvmType 'String'.". Attaching the screen shoot for your reference.
Could you please tell, what am I missing here ?
[Updated on: Wed, 14 August 2013 09:07] Report message to a moderator
|
|
|
|
|
|
|
Re: Xtext-enabled TextArea [message #1086498 is a reply to message #1086496] |
Wed, 14 August 2013 09:20 |
|
Hi,
using a different version of org.eclipse.xtext.ui.editor.embedded.IEditedResourceProvider
e.g.
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("platform./resource/"+project.getname()+"/test.mql"));
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Wed, 14 August 2013 09:20] Report message to a moderator
|
|
|
|
|
|
Re: Xtext-enabled TextArea [message #1086519 is a reply to message #1086508] |
Wed, 14 August 2013 09:48 |
|
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
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Powered by
FUDForum. Page generated in 0.02306 seconds