本文整理汇总了Java中com.intellij.openapi.util.TextRange.contains方法的典型用法代码示例。如果您正苦于以下问题:Java TextRange.contains方法的具体用法?Java TextRange.contains怎么用?Java TextRange.contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.TextRange
的用法示例。
在下文中一共展示了TextRange.contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertLocalInspectionContains
import com.intellij.openapi.util.TextRange; //导入方法依赖的package包/类
public void assertLocalInspectionContains(String filename, String content, String contains) {
Set<String> matches = new HashSet<String>();
Pair<List<ProblemDescriptor>, Integer> localInspectionsAtCaret = getLocalInspectionsAtCaret(filename, content);
for (ProblemDescriptor result : localInspectionsAtCaret.getFirst()) {
TextRange textRange = result.getPsiElement().getTextRange();
if (textRange.contains(localInspectionsAtCaret.getSecond()) && result.toString().equals(contains)) {
return;
}
matches.add(result.toString());
}
fail(String.format("Fail matches '%s' with one of %s", contains, matches));
}
示例2: assertLocalInspectionContainsNotContains
import com.intellij.openapi.util.TextRange; //导入方法依赖的package包/类
public void assertLocalInspectionContainsNotContains(String filename, String content, String contains) {
Pair<List<ProblemDescriptor>, Integer> localInspectionsAtCaret = getLocalInspectionsAtCaret(filename, content);
for (ProblemDescriptor result : localInspectionsAtCaret.getFirst()) {
TextRange textRange = result.getPsiElement().getTextRange();
if (textRange.contains(localInspectionsAtCaret.getSecond())) {
fail(String.format("Fail inspection not contains '%s'", contains));
}
}
}
示例3: assertLocalInspectionIsEmpty
import com.intellij.openapi.util.TextRange; //导入方法依赖的package包/类
protected void assertLocalInspectionIsEmpty(String filename, String content) {
Pair<List<ProblemDescriptor>, Integer> localInspectionsAtCaret = getLocalInspectionsAtCaret(filename, content);
for (ProblemDescriptor result : localInspectionsAtCaret.getFirst()) {
TextRange textRange = result.getPsiElement().getTextRange();
if (textRange.contains(localInspectionsAtCaret.getSecond())) {
fail("Fail that matches is empty");
}
}
}