Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [xtext-dev] Howto read a model without editor?

Hi Pierrick,

please have a look at the FAQ: 


Please note that you should use the injector from your activator instead and skip the standalone setup part.

Regards,
Sebastian


On 03.08.2010, at 14:22, Pierrick Koch wrote:

Hi, eclipse forum is down, so I'm posting here :)

I'm working with Xtext and I'd like to read (or parse) a Model from a file without having to open it in an editor.

for now I use 
EditorUtils.getActiveXtextEditor().getDocument()
or XtextDocumentUtil.get(IEditorPart)

both of those methods open or need an opened file.

I tried with 
ResourceSet rs = new ResourceSetImpl();
Resource resource = rs.getResource(URI.createURI(myIFile.getFullPath().toString()), true);
EObject model = resource.getContents().get(0);

but the problem is that the references are not resolved.

Is there a way to get a model with resolved references without opening it in an editor ?

Cheers,
Pierrick
_______________________________________________
xtext-dev mailing list
xtext-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/xtext-dev


Back to the top