Java Code Examples for org.eclipse.xtext.linking.impl.ImportedNamesAdapter#find()
The following examples show how to use
org.eclipse.xtext.linking.impl.ImportedNamesAdapter#find() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: N4JSLinker.java From n4js with Eclipse Public License 1.0 | 5 votes |
/** * Removes the imported names before linking and cleans other caches attached to the AST. */ @Override protected void beforeModelLinked(EObject model, IDiagnosticConsumer diagnosticsConsumer) { ImportedNamesAdapter adapter = ImportedNamesAdapter.find(model.eResource()); if (adapter != null) adapter.clear(); ComposedMemberScope.clearCachedComposedMembers(model); }
Example 2
Source File: ImportedNamesRecordingScopeAccess.java From n4js with Eclipse Public License 1.0 | 5 votes |
/** * Obtain the previously registered adapter for the imported names or register a new one. * * @param context * the resource that is supposed to hold the adapter */ private ImportedNamesAdapter getImportedNamesAdapter(Resource context) { ImportedNamesAdapter adapter = ImportedNamesAdapter.find(context); if (adapter != null) return adapter; ImportedNamesAdapter importedNamesAdapter = importedNamesAdapterProvider.get(); context.eAdapters().add(importedNamesAdapter); return importedNamesAdapter; }
Example 3
Source File: DefaultResourceDescription.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
@Override public Iterable<QualifiedName> getImportedNames() { EcoreUtil2.resolveLazyCrossReferences(resource, CancelIndicator.NullImpl); ImportedNamesAdapter adapter = ImportedNamesAdapter.find(getResource()); if (adapter != null) { ImmutableSet<QualifiedName> result = ImmutableSet.copyOf(adapter.getImportedNames()); return result; } return Collections.emptySet(); }
Example 4
Source File: ResourceDescription2.java From dsl-devkit with Eclipse Public License 1.0 | 5 votes |
/** * {@inheritDoc} */ @Override public Map<QualifiedName, Set<EClass>> getImportedNamesTypes() { ImportedNamesAdapter adapter = ImportedNamesAdapter.find(getResource()); if (adapter instanceof ImportedNamesTypesAdapter) { return ImmutableMap.copyOf(((ImportedNamesTypesAdapter) adapter).getImportedNamesTypes()); } return Collections.emptyMap(); }
Example 5
Source File: LinkingService.java From dsl-devkit with Eclipse Public License 1.0 | 5 votes |
@Override protected ImportedNamesTypesAdapter getImportedNamesAdapter(final EObject context) { ImportedNamesAdapter adapter = ImportedNamesAdapter.find(context.eResource()); if (adapter instanceof ImportedNamesTypesAdapter) { return (ImportedNamesTypesAdapter) adapter; } ImportedNamesTypesAdapter importedNamesTypeAdapter = importedNamesAdapterProvider.get(); context.eResource().eAdapters().add(importedNamesTypeAdapter); return importedNamesTypeAdapter; }