private List<AutoCompletionChoice> getEntityAutocompletionChoices(GetManchesterSyntaxFrameCompletionsAction action, OWLAPIProject project, ParserException e, EditorPosition fromPos, EditorPosition toPos, String lastWordPrefix) {
List<AutoCompletionMatch> matches = Lists.newArrayList();
Set<EntityType<?>> expectedEntityTypes = Sets.newHashSet(ManchesterSyntaxFrameParser.getExpectedEntityTypes(e));
if(!expectedEntityTypes.isEmpty()) {
BidirectionalShortFormProvider shortFormProvider = project.getRenderingManager().getShortFormProvider();
for(String shortForm : shortFormProvider.getShortForms()) {
EntityNameMatcher entityNameMatcher = new EntityNameMatcher(lastWordPrefix);
Optional<EntityNameMatchResult> match = entityNameMatcher.findIn(shortForm);
if(match.isPresent()) {
Set<OWLEntity> entities = shortFormProvider.getEntities(shortForm);
for(OWLEntity entity : entities) {
if(expectedEntityTypes.contains(entity.getEntityType())) {
EscapingShortFormProvider escapingShortFormProvider = new EscapingShortFormProvider(shortFormProvider);
AutoCompletionChoice choice = new AutoCompletionChoice(escapingShortFormProvider.getShortForm(entity), shortForm, "", fromPos, toPos);
AutoCompletionMatch autoCompletionMatch = new AutoCompletionMatch(