use of org.eclipse.xtext.workspace.IWorkspaceConfig 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.IWorkspaceConfig in project xtext-core by eclipse.
the class WorkspaceManager method refreshWorkspaceConfig.
/**
* Refresh the workspace.
*/
protected void refreshWorkspaceConfig(CancelIndicator cancelIndicator) {
IWorkspaceConfig newWorkspaceConfig = createWorkspaceConfig();
setWorkspaceConfig(newWorkspaceConfig);
List<ProjectDescription> newProjects = new ArrayList<>();
Set<String> projectNames = projectName2ProjectManager.keySet();
Set<String> remainingProjectNames = new HashSet<>(projectNames);
for (IProjectConfig projectConfig : getWorkspaceConfig().getProjects()) {
if (projectName2ProjectManager.containsKey(projectConfig.getName())) {
remainingProjectNames.remove(projectConfig.getName());
} else {
ProjectManager projectManager = projectManagerProvider.get();
ProjectDescription projectDescription = projectDescriptionFactory.getProjectDescription(projectConfig);
projectManager.initialize(projectDescription, projectConfig, issueAcceptor, openedDocumentsContentProvider, () -> fullIndex, cancelIndicator);
projectName2ProjectManager.put(projectDescription.getName(), projectManager);
newProjects.add(projectDescription);
}
}
for (String deletedProject : remainingProjectNames) {
ProjectManager projectManager = projectName2ProjectManager.remove(deletedProject);
projectManager.aboutToRemoveFromWorkspace();
fullIndex.remove(deletedProject);
}
afterBuild(buildManager.doInitialBuild(newProjects, cancelIndicator));
}
use of org.eclipse.xtext.workspace.IWorkspaceConfig in project xtext-core by eclipse.
the class LiveShadowedChunkedContainer method getProjectConfig.
protected IProjectConfig getProjectConfig() {
if ((!this.isProjectConfigSet)) {
IWorkspaceConfig _workspaceConfig = this.descriptions.getWorkspaceConfig();
IProjectConfig _findProjectByName = null;
if (_workspaceConfig != null) {
_findProjectByName = _workspaceConfig.findProjectByName(this.containerName);
}
this.projectConfig = _findProjectByName;
this.isProjectConfigSet = true;
}
return this.projectConfig;
}
use of org.eclipse.xtext.workspace.IWorkspaceConfig 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