Skip to content

lookupElementOfType does not work as intended #102

@sebinside

Description

@sebinside

The method lookupElementOfType in the resource provider (e.g., the PCMURIResourceProvider) is described to Looks up an ECore element with the given class type. However, this only works with root level elements, e.g., Repository, or system model. It does not work recursively with all contained elements (at least in my tests):

resourceProvider.lookupElementOfType(RepositoryPackage.eINSTANCE.getRepository()); // This works and returns the repository
resourceProvider.lookupElementOfType(RepositoryPackage.eINSTANCE.getBasicComponent()); // This returns an empty list

Not only would this feature help when quickly scanning through models, it's also unintuitive as lookupElementWithId also works with all non top-level elements.

TL;DR: Please make lookupElementOfType find all elements 🚀

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions