Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How do I change the Matcher at ContentAssistContext?
How do I change the Matcher at ContentAssistContext? [message #701652] Mon, 25 July 2011 11:56 Go to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
Hi anybody,

I want to migrate our modeling-project to indigo and found a
code that looks like a workaround:

In overriden method
complete_JavaRefType(EObject model, RuleCall ruleCall, ContentAssistContext context,
ICompletionProposalAcceptor acceptor) {



try {
PrefixMatcher matcher = new PrefixMatcher() {

@Override
public boolean isCandidateMatchingPrefix(String name, String prefix) {
name = name.replaceAll("\\^", "");
prefix = prefix.replaceAll("\\^", "");
return original.isCandidateMatchingPrefix(name, prefix);
}

};
context.setMatcher(matcher);
ITypeProposalAcceptor typeProposalAcceptor = new DefaultTypeProposalAcceptor(context, acceptor);

completeJavaType(model, feature, context.getPrefix(), typeProposalAcceptor);
} finally {
context.setMatcher(original);
}

That dowsn't compile anymore in 2.0.0, because setMatcher not available anymore.
How can I make this workaround work again or how can I get rid of it?


Thanks for your help
Best regards
Markus

}
Re: How do I change the Matcher at ContentAssistContext? [message #701653 is a reply to message #701652] Mon, 25 July 2011 11:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

the setMatcher has moved into the Builder
(see copy method)

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How do I change the Matcher at ContentAssistContext? [message #701729 is a reply to message #701653] Mon, 25 July 2011 13:55 Go to previous message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
OK, Thank you...
Previous Topic:"static initializer is exceeding the 65535 bytes limit" with xtext2.0
Next Topic:What has happened to org.eclipse.xtext.builder.builderState.PersistableResourceDescriptionsImpl?
Goto Forum:
  


Current Time: Thu Apr 18 19:57:34 GMT 2024

Powered by FUDForum. Page generated in 0.02078 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top