use of com.intellij.structuralsearch.MatchOptions in project intellij-community by JetBrains.
the class GuavaOptionalConversionUtil method simplifyParameterPattern.
static String simplifyParameterPattern(PsiMethodCallExpression methodCall) {
final PsiExpressionList argumentList = methodCall.getArgumentList();
final PsiExpression[] expressions = argumentList.getExpressions();
if (expressions.length == 1) {
final PsiExpression expression = expressions[0];
Matcher matcher = new Matcher(methodCall.getProject());
final MatchOptions options = new MatchOptions();
options.setFileType(StdFileTypes.JAVA);
final List<MatchResult> results = matcher.testFindMatches(expression.getText(), GuavaOptionalConversionRule.OPTIONAL_CONVERTOR_PATTERN, options, false);
if (!results.isEmpty()) {
final MatchResult result = results.get(0);
if (result.getStart() == 0 && result.getEnd() == -1) {
return GuavaOptionalConversionRule.OPTIONAL_CONVERTOR_PATTERN;
}
}
}
return "$o$";
}
use of com.intellij.structuralsearch.MatchOptions in project intellij-community by JetBrains.
the class FindInFilesOptimizingSearchHelper method doAddSearchWordInLiterals.
protected void doAddSearchWordInLiterals(final String refname) {
final MatchOptions options = context.getOptions();
CacheManager.SERVICE.getInstance(myProject).processFilesWithWord(myFileProcessor, refname, UsageSearchContext.IN_STRINGS, (GlobalSearchScope) options.getScope(), options.isCaseSensitiveMatch());
}
use of com.intellij.structuralsearch.MatchOptions in project intellij-community by JetBrains.
the class FindInFilesOptimizingSearchHelper method doAddSearchWordInComments.
protected void doAddSearchWordInComments(final String refname) {
final MatchOptions options = context.getOptions();
CacheManager.SERVICE.getInstance(myProject).processFilesWithWord(myFileProcessor, refname, UsageSearchContext.IN_COMMENTS, (GlobalSearchScope) options.getScope(), options.isCaseSensitiveMatch());
}
Aggregations