use of org.eclipse.xtext.workspace.WorkspaceConfig in project xtext-core by eclipse.
the class ProjectWorkspaceConfigFactory method getWorkspaceConfig.
@Override
public IWorkspaceConfig getWorkspaceConfig(final URI workspaceBaseURI) {
final WorkspaceConfig workspaceConfig = new WorkspaceConfig();
this.findProjects(workspaceConfig, workspaceBaseURI);
return workspaceConfig;
}
use of org.eclipse.xtext.workspace.WorkspaceConfig in project xtext-core by eclipse.
the class IndexOnlyProjectTest method getServerModule.
@Override
public com.google.inject.Module getServerModule() {
return Modules2.mixin(new ServerModule(), new Module() {
@Override
public void configure(Binder binder) {
binder.bind(IMultiRootWorkspaceConfigFactory.class).toInstance(new MultiRootWorkspaceConfigFactory() {
@Override
public void addProjectsForWorkspaceFolder(WorkspaceConfig workspaceConfig, WorkspaceFolder workspaceFolder, Set<String> existingNames) {
String uri = null;
if (workspaceFolder != null) {
uri = workspaceFolder.getUri();
}
if (uri != null) {
FileProjectConfig project = new FileProjectConfig(getUriExtensions().toUri(workspaceFolder.getUri()), getUniqueProjectName(workspaceFolder.getName(), existingNames)) {
@Override
public boolean isIndexOnly() {
return true;
}
};
project.addSourceFolder(".");
workspaceConfig.addProject(project);
}
}
});
}
});
}
use of org.eclipse.xtext.workspace.WorkspaceConfig in project xtext-core by eclipse.
the class LiveShadowedChunkedContainerTest method setUp.
@Before
public void setUp() throws Exception {
workspaceConfig = new WorkspaceConfig();
fooProject = new ProjectConfig("foo", workspaceConfig);
barProject = new ProjectConfig("bar", workspaceConfig);
XtextResourceSet rs0 = resourceSetProvider.get();
fooURI = Iterables.getFirst(fooProject.getSourceFolders(), null).getPath().trimSegments(1).appendSegment("foo.livecontainertestlanguage");
barURI = Iterables.getFirst(barProject.getSourceFolders(), null).getPath().trimSegments(1).appendSegment("bar.livecontainertestlanguage");
Map<String, ResourceDescriptionsData> chunks = ImmutableMap.<String, ResourceDescriptionsData>builder().put("foo", createResourceDescriptionData(Collections.singletonList(parseHelper.parse("foo", fooURI, rs0).eResource()))).put("bar", createResourceDescriptionData(Collections.singletonList(parseHelper.parse("bar", barURI, rs0).eResource()))).build();
rs1 = resourceSetProvider.get();
new ChunkedResourceDescriptions(chunks, rs1);
ProjectConfigAdapter.install(rs1, fooProject);
liveShadowedChunkedResourceDescriptions = provider.get();
liveShadowedChunkedResourceDescriptions.setContext(rs1);
fooContainer = new LiveShadowedChunkedContainer(liveShadowedChunkedResourceDescriptions, "foo");
barContainer = new LiveShadowedChunkedContainer(liveShadowedChunkedResourceDescriptions, "bar");
}
use of org.eclipse.xtext.workspace.WorkspaceConfig in project xtext-core by eclipse.
the class MultiRootWorkspaceConfigFactory method getWorkspaceConfig.
@Override
public IWorkspaceConfig getWorkspaceConfig(List<WorkspaceFolder> workspaceFolders) {
WorkspaceConfig workspaceConfig = new WorkspaceConfig();
Set<String> existingProjectNames = new HashSet<>();
for (WorkspaceFolder workspaceFolder : workspaceFolders) addProjectsForWorkspaceFolder(workspaceConfig, workspaceFolder, existingProjectNames);
return workspaceConfig;
}
Aggregations