Search in sources :

Example 1 with IgnoreCase

use of org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher.IgnoreCase in project xtext-eclipse by eclipse.

the class Bug349773Test method createMatcher.

@Override
protected FQNPrefixMatcher createMatcher() {
    IgnoreCase ignoreCase = new PrefixMatcher.IgnoreCase();
    FQNPrefixMatcher result = new FQNPrefixMatcher();
    result.setDelegate(ignoreCase);
    result.setLastSegmentFinder(new FQNPrefixMatcher.DefaultLastSegmentFinder());
    return result;
}
Also used : IgnoreCase(org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher.IgnoreCase) FQNPrefixMatcher(org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher)

Example 2 with IgnoreCase

use of org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher.IgnoreCase in project xtext-eclipse by eclipse.

the class FQNPrefixMatcherTest method createMatcher.

@Override
protected FQNPrefixMatcher createMatcher() {
    IgnoreCase ignoreCase = new PrefixMatcher.IgnoreCase();
    FQNPrefixMatcher result = new FQNPrefixMatcher();
    result.setDelegate(ignoreCase);
    result.setLastSegmentFinder(new FQNPrefixMatcher.LastSegmentFinder() {

        @Override
        public String getLastSegment(String fqn, char delimiter) {
            int i = fqn.lastIndexOf(delimiter);
            if (i >= 0) {
                if (i != fqn.length() - 1)
                    return fqn.substring(i + 1);
                return "";
            }
            return fqn;
        }
    });
    return result;
}
Also used : IgnoreCase(org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher.IgnoreCase) FQNPrefixMatcher(org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher)

Aggregations

FQNPrefixMatcher (org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher)2 IgnoreCase (org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher.IgnoreCase)2