本文整理汇总了Java中com.intellij.codeInsight.completion.CompletionUtil.iterateLookupStrings方法的典型用法代码示例。如果您正苦于以下问题:Java CompletionUtil.iterateLookupStrings方法的具体用法?Java CompletionUtil.iterateLookupStrings怎么用?Java CompletionUtil.iterateLookupStrings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.completion.CompletionUtil
的用法示例。
在下文中一共展示了CompletionUtil.iterateLookupStrings方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addElement
import com.intellij.codeInsight.completion.CompletionUtil; //导入方法依赖的package包/类
@Override
public void addElement(LookupElement added, ProcessingContext context) {
myCount++;
for (String string : CompletionUtil.iterateLookupStrings(added)) {
if (string.length() == 0) continue;
myElements.putValue(string, added);
mySortedStrings.add(string);
final NavigableSet<String> after = mySortedStrings.tailSet(string, false);
for (String s : after) {
if (!s.startsWith(string)) {
break;
}
for (LookupElement longer : myElements.get(s)) {
updateLongerItem(added, longer);
}
}
}
super.addElement(added, context);
calculateToLift(added);
}
示例2: addElement
import com.intellij.codeInsight.completion.CompletionUtil; //导入方法依赖的package包/类
@Override
public void addElement(@Nonnull LookupElement added, @Nonnull ProcessingContext context) {
myCount++;
for (String string : CompletionUtil.iterateLookupStrings(added)) {
if (string.length() == 0) continue;
myElements.putValue(string, added);
mySortedStrings.add(string);
final NavigableSet<String> after = mySortedStrings.tailSet(string, false);
for (String s : after) {
if (!s.startsWith(string)) {
break;
}
for (LookupElement longer : myElements.get(s)) {
updateLongerItem(added, longer);
}
}
}
super.addElement(added, context);
calculateToLift(added);
}
示例3: calculateToLift
import com.intellij.codeInsight.completion.CompletionUtil; //导入方法依赖的package包/类
private void calculateToLift(LookupElement element) {
for (String string : CompletionUtil.iterateLookupStrings(element)) {
for (int len = 1; len < string.length(); len++) {
String prefix = string.substring(0, len);
for (LookupElement shorterElement : myElements.get(prefix)) {
if (myCondition.shouldLift(shorterElement, element)) {
myToLift.putValue(element, shorterElement);
myReversedToLift.putValue(shorterElement, element);
}
}
}
}
}
示例4: removeElement
import com.intellij.codeInsight.completion.CompletionUtil; //导入方法依赖的package包/类
@Override
public void removeElement(LookupElement element, ProcessingContext context) {
for (String s : CompletionUtil.iterateLookupStrings(element)) {
myElements.remove(s, element);
if (myElements.get(s).isEmpty()) {
mySortedStrings.remove(s);
}
}
removeFromMap(element, myToLift, myReversedToLift);
removeFromMap(element, myReversedToLift, myToLift);
super.removeElement(element, context);
}
示例5: isStartMatch
import com.intellij.codeInsight.completion.CompletionUtil; //导入方法依赖的package包/类
@Override
public boolean isStartMatch(LookupElement element) {
for (String s : CompletionUtil.iterateLookupStrings(element)) {
FList<TextRange> ranges = myCaseInsensitiveMatcher.matchingFragments(s);
if (ranges == null) continue;
if (ranges.isEmpty() || skipUnderscores(s) >= ranges.get(0).getStartOffset()) {
return true;
}
}
return false;
}
示例6: removeElement
import com.intellij.codeInsight.completion.CompletionUtil; //导入方法依赖的package包/类
@Override
public void removeElement(@Nonnull LookupElement element, @Nonnull ProcessingContext context) {
for (String s : CompletionUtil.iterateLookupStrings(element)) {
myElements.remove(s, element);
if (myElements.get(s).isEmpty()) {
mySortedStrings.remove(s);
}
}
removeFromMap(element, myToLift, myReversedToLift);
removeFromMap(element, myReversedToLift, myToLift);
super.removeElement(element, context);
}