Class ResourceDescriptionsProvider

    • Field Detail

      • NAMED_BUILDER_SCOPE

        public static final java.lang.String NAMED_BUILDER_SCOPE
        This flag configures Xtext's scoping for a ResourceSet for the (incremental) build. This should not be used by clients, since it is tailored for org.eclipse.xtext.builder.impl.XtextBuilder.
        See Also:
        Constant Field Values
      • LIVE_SCOPE

        public static final java.lang.String LIVE_SCOPE
        This flag configures Xtext's scoping for a ResourceSet to use Xtext's index shadowed by the dirty editors' state shadowed by the ResourceSet's contents. I.e., scoping will look for a IResourceDescription first in the ResourecSet, then in dirty editors and then in the index. If possible, don't use this this flag directly but use org.eclipse.xtext.ui.resource.LiveScopeResourceSetInitializer instead.
        See Also:
        Constant Field Values
      • PERSISTED_DESCRIPTIONS

        public static final java.lang.String PERSISTED_DESCRIPTIONS
        This flag configures Xtext's scoping for a ResourceSet to use Xtext's index only. Dirty state and the ResourceSet's contents are ignored.
        Since:
        2.6
        See Also:
        Constant Field Values
    • Constructor Detail

      • ResourceDescriptionsProvider

        public ResourceDescriptionsProvider()
    • Method Detail

      • getResourceDescriptions

        public IResourceDescriptions getResourceDescriptions​(org.eclipse.emf.ecore.resource.Resource resource)
      • getResourceDescriptions

        public IResourceDescriptions getResourceDescriptions​(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
        Provides the proper resource descriptions according to the context in which the resource set is used. The context is indicated by the load options of the resource set. Supported options are:
        1. NAMED_BUILDER_SCOPE
        2. LIVE_SCOPE
        3. PERSISTED_DESCRIPTIONS
        4. If no such option is present the dirty editors are taken into account to contribute their contents to the index
        The result is never null.
        Specified by:
        getResourceDescriptions in interface IResourceDescriptionsProvider
        Parameters:
        resourceSet - the resource set that is currently used.
        Returns:
        the IResourceDescriptions according to the usage context.
        Since:
        2.1
      • createLiveScopeResourceDescriptions

        public IResourceDescriptions createLiveScopeResourceDescriptions()
        The returned IResourceDescriptions represent the Xtext Index' state shadowed by the Editors Dirty State shadowed by the current ResourceSets contents.
      • createBuilderScopeResourceDescriptions

        public IResourceDescriptions createBuilderScopeResourceDescriptions()
        The returned IResourceDescriptions are used by the Xtext Builder to update the Index.
      • createResourceDescriptions

        public IResourceDescriptions createResourceDescriptions()
        The returned IResourceDescriptions represent the Xtext Index' state shadowed by the Editors Dirty State.
      • createPersistedResourceDescriptions

        public IResourceDescriptions createPersistedResourceDescriptions()
        The returned IResourceDescriptions represent the Xtext Index' state (not shadowed by anything).
        Throws:
        java.lang.IllegalStateException - if the builder integration is not configured for this language but the persisted descriptions are requested
        Since:
        2.6
      • setBuilderScopeResourceDescriptions

        public void setBuilderScopeResourceDescriptions​(com.google.inject.Provider<IResourceDescriptions> resourceDescriptions)
      • setResourceDescriptions

        public void setResourceDescriptions​(com.google.inject.Provider<IResourceDescriptions> resourceDescriptions)
      • setLiveScopeResourceDescriptions

        public void setLiveScopeResourceDescriptions​(com.google.inject.Provider<IResourceDescriptions> liveScopeResourceDescriptions)
        Since:
        2.6
      • setPersistedResourceDescriptions

        public void setPersistedResourceDescriptions​(com.google.inject.Provider<IResourceDescriptions> persistedResourceDescriptions)
        Since:
        2.6