|
|
|
|
Re: How could we get XtextResource objects of the files which already opened in the editor? [message #1700197 is a reply to message #1700183] |
Tue, 30 June 2015 15:41 |
kimi raikonnan Messages: 145 Registered: June 2015 |
Senior Member |
|
|
Hi,
In XtextBuilder method doBuild() , this line resourceSet.getResources().clear();, which means that all the resources will be cleared after the build directly, so we will not be able to pickup the resources from the resource set, am i right?
Here is the code i tried to pick up them with
ICommand command = getCommand(project, "org.eclipse.xtext.ui.shared.xtextBuilder");
IBuildConfiguration config = project.getActiveBuildConfig();
InternalBuilder internalBuilder = ((BuildCommand) command).getBuilder(config);
IncrementalProjectBuilder incrementalProjectBuilder = (IncrementalProjectBuilder) internalBuilder;
XtextBuilder xTextBuilder = (XtextBuilder) incrementalProjectBuilder;
IResourceSetProvider provide = xTextBuilder.getResourceSetProvider();
ResourceSet resouarceSet = provide.get(project);
EList<Resource> res = resouarceSet.getResources();
int kk = res.size();
[Updated on: Tue, 30 June 2015 15:46] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03263 seconds