use of org.eclipse.xtext.workspace.IProjectConfig in project xtext-core by eclipse.
the class CharSequenceTraceWrapper method wrapWithTraceData.
public CharSequence wrapWithTraceData(CharSequence sequence, EObject origin) {
ITextRegionWithLineInformation location = (ITextRegionWithLineInformation) locationInFileProvider.getSignificantTextRegion(origin);
AbsoluteURI absoluteURI = new AbsoluteURI(origin.eResource().getURI());
IProjectConfig projectConfig = projectConfigProvider.getProjectConfig(EcoreUtil2.getResourceSet(origin));
SourceRelativeURI sourceRelativeURI = absoluteURI.deresolve(projectConfig);
return wrapWithTraceData(sequence, sourceRelativeURI, location.getOffset(), location.getLength(), location.getLineNumber(), location.getEndLineNumber());
}
use of org.eclipse.xtext.workspace.IProjectConfig in project xtext-core by eclipse.
the class AbstractTrace method getBestAssociatedLocation.
@Override
public ILocationInResource getBestAssociatedLocation(ITextRegion localRegion, AbsoluteURI uri) {
IProjectConfig projectConfig = getLocalProjectConfig();
AbstractTraceRegion left = findTraceRegionAtLeftOffset(localRegion.getOffset());
left = findParentByURI(left, uri, projectConfig);
AbstractTraceRegion right = findTraceRegionAtRightOffset(localRegion.getOffset() + localRegion.getLength());
right = findParentByURI(right, uri, projectConfig);
return mergeRegions(left, right);
}
use of org.eclipse.xtext.workspace.IProjectConfig in project xtext-core by eclipse.
the class LiveShadowedChunkedContainer method isContained.
protected boolean isContained(final URI uri) {
boolean _or = false;
IResourceDescription _resourceDescription = this.getChunk().getResourceDescription(uri);
boolean _tripleNotEquals = (_resourceDescription != null);
if (_tripleNotEquals) {
_or = true;
} else {
IProjectConfig _projectConfig = this.getProjectConfig();
ISourceFolder _findSourceFolderContaining = null;
if (_projectConfig != null) {
_findSourceFolderContaining = _projectConfig.findSourceFolderContaining(uri);
}
boolean _tripleNotEquals_1 = (_findSourceFolderContaining != null);
_or = _tripleNotEquals_1;
}
return _or;
}
use of org.eclipse.xtext.workspace.IProjectConfig 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.IProjectConfig in project xtext-core by eclipse.
the class LiveShadowedChunkedResourceDescriptions method setContext.
@Override
public void setContext(final Notifier ctx) {
IResourceDescriptions _localDescriptions = this.getLocalDescriptions();
final Procedure1<ResourceSetBasedResourceDescriptions> _function = (ResourceSetBasedResourceDescriptions it) -> {
it.setContext(ctx);
it.setData(null);
};
ObjectExtensions.<ResourceSetBasedResourceDescriptions>operator_doubleArrow(((ResourceSetBasedResourceDescriptions) _localDescriptions), _function);
final ResourceSet resourceSet = EcoreUtil2.getResourceSet(ctx);
this.setGlobalDescriptions(ChunkedResourceDescriptions.findInEmfObject(resourceSet));
IProjectConfig _projectConfig = null;
if (this.projectConfigProvider != null) {
_projectConfig = this.projectConfigProvider.getProjectConfig(resourceSet);
}
IWorkspaceConfig _workspaceConfig = null;
if (_projectConfig != null) {
_workspaceConfig = _projectConfig.getWorkspaceConfig();
}
this.workspaceConfig = _workspaceConfig;
}
Aggregations