use of com.intellij.structuralsearch.plugin.ui.SearchConfiguration in project intellij-community by JetBrains.
the class SSRCodeInsightTest method doTest.
private void doTest(final String searchPattern, final String patternName) {
final SearchConfiguration configuration = new SearchConfiguration();
//display name
configuration.setName(patternName);
//search pattern
final MatchOptions options = new MatchOptions();
options.setFileType(StdFileTypes.JAVA);
options.setSearchPattern(searchPattern);
configuration.setMatchOptions(options);
myInspection.setConfigurations(Collections.<Configuration>singletonList(configuration), myFixture.getProject());
myFixture.testHighlighting(true, false, false, getTestName(false) + ".java");
}
use of com.intellij.structuralsearch.plugin.ui.SearchConfiguration in project intellij-community by JetBrains.
the class SSBasedInspectionTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
SSBasedInspection inspection = new SSBasedInspection();
List<Configuration> configurations = new ArrayList<>();
SearchConfiguration configuration = new SearchConfiguration();
MatchOptions options = new MatchOptions();
options.setFileType(StdFileTypes.JAVA);
options.setSearchPattern("int i;");
configuration.setMatchOptions(options);
configurations.add(configuration);
configuration = new SearchConfiguration();
options = new MatchOptions();
options.setFileType(StdFileTypes.JAVA);
options.setSearchPattern("f();");
configuration.setMatchOptions(options);
configurations.add(configuration);
inspection.setConfigurations(configurations, myProject);
myWrapper = new LocalInspectionToolWrapper(inspection);
}
use of com.intellij.structuralsearch.plugin.ui.SearchConfiguration in project intellij-community by JetBrains.
the class PredefinedConfigurationUtil method createSearchTemplateInfo.
public static Configuration createSearchTemplateInfo(String name, @NonNls String criteria, String category, FileType fileType) {
final SearchConfiguration config = new SearchConfiguration();
config.setPredefined(true);
config.setName(name);
config.setCategory(category);
final MatchOptions options = config.getMatchOptions();
options.setSearchPattern(criteria);
options.setFileType(fileType);
options.setCaseSensitiveMatch(true);
MatcherImplUtil.transform(options);
return config;
}
Aggregations