use of org.eclipse.xtext.ide.server.MultiRootWorkspaceConfigFactory 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);
}
}
});
}
});
}
Aggregations