当前位置: 首页>>代码示例>>Java>>正文


Java CompletionUtil.iterateLookupStrings方法代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:LiftShorterItemsClassifier.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:LiftShorterItemsClassifier.java

示例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);
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:LiftShorterItemsClassifier.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:LiftShorterItemsClassifier.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:CamelHumpMatcher.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:LiftShorterItemsClassifier.java


注:本文中的com.intellij.codeInsight.completion.CompletionUtil.iterateLookupStrings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。