Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
292,800
boolean (Object obj) { return obj.getClass() == StructuralSearchInspectionToolWrapper.class && ((StructuralSearchInspectionToolWrapper)obj).myTool.getShortName().equals(myTool.getShortName()); }
equals
292,801
LocalInspectionToolWrapper () { final StructuralSearchFakeInspection inspection = (StructuralSearchFakeInspection)getTool(); final List<Configuration> copies = new SmartList<>(); for (Configuration configuration : inspection.getConfigurations()) { copies.add(configuration.copy()); } return new StructuralSearchInspectio...
createCopy
292,802
String () { return getTool().getDisplayName(); }
getDisplayName
292,803
boolean () { return true; }
isEnabledByDefault
292,804
String () { return getTool().getID(); }
getID
292,805
String () { return getTool().getGroupDisplayName(); }
getGroupDisplayName
292,806
boolean () { return ((StructuralSearchFakeInspection)myTool).isCleanup(); }
isCleanupTool
292,807
SSBasedInspection (@NotNull InspectionProfile profile) { return (SSBasedInspection)CustomInspectionActions.getInspection(profile, SHORT_NAME); }
getStructuralSearchInspection
292,808
String () { return getGeneralGroupName(); }
getGroupDisplayName
292,809
String () { return SHORT_NAME; }
getShortName
292,810
void (@NotNull GlobalInspectionContext context) { super.initialize(context); mySessionProfile = ((GlobalInspectionContextBase)context).getCurrentProfile(); }
initialize
292,811
void (@NotNull Project project) { super.cleanup(project); mySessionProfile = null; myCompiledPatterns.clear(); }
cleanup
292,812
void (@NotNull LocalInspectionToolSession session, @NotNull ProblemsHolder problemsHolder) { final Map<Configuration, Matcher> compiledPatterns = session.getUserData(COMPILED_PATTERNS); if (compiledPatterns != null) { checkInCompiledPatterns(compiledPatterns); } }
inspectionFinished
292,813
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly, @NotNull LocalInspectionToolSession session) { if (myConfigurations.isEmpty()) return PsiElementVisitor.EMPTY_VISITOR; final PsiFile file = holder.getFile(); final FileType fileType = file.getFileType(); if (fileType instanceof PlainTextLikeFileType...
buildVisitor
292,814
void (@NotNull Configuration configuration) { if (configuration.getOrder() != 0) { // not a main configuration containing meta data return; } // modify from single (event) thread, to prevent race conditions. ApplicationManager.getApplication().invokeLater(() -> { final String shortName = configuration.getUuid(); final ...
register
292,815
boolean (@NotNull Configuration configuration, @NotNull HighlightDisplayKey key) { if (StringUtil.isEmpty(configuration.getSuppressId())) { if (!SHORT_NAME.equals(key.getID())) return true; } else if (!configuration.getSuppressId().equals(key.getID())) return true; return !configuration.getName().equals(HighlightDispla...
isMetaDataChanged
292,816
List<LocalInspectionToolWrapper> () { return getConfigurations().stream() .filter(configuration -> configuration.getOrder() == 0) .map(configuration -> new StructuralSearchInspectionToolWrapper(getConfigurationsWithUuid(configuration.getUuid()))) .collect(Collectors.toList()); }
getChildren
292,817
LocalQuickFix (@NotNull Project project, @NotNull MatchResult matchResult, @NotNull Configuration configuration) { if (!(configuration instanceof ReplaceConfiguration)) return null; return new StructuralQuickFix(project, matchResult, configuration.getReplaceOptions()); }
createQuickFix
292,818
Configuration (@NotNull Configuration configuration) { if (configuration.getOrder() == 0) { return configuration; } final String uuid = configuration.getUuid(); return myConfigurations.stream().filter(c -> c.getOrder() == 0 && uuid.equals(c.getUuid())).findFirst().orElse(configuration); }
getMainConfiguration
292,819
List<Configuration> () { return new SmartList<>(myConfigurations); }
getConfigurations
292,820
List<Configuration> (@NotNull String uuid) { return ContainerUtil.sorted(ContainerUtil.filter(myConfigurations, c -> uuid.equals(c.getUuid())), Comparator.comparingInt(Configuration::getOrder)); }
getConfigurationsWithUuid
292,821
boolean (@NotNull Configuration configuration) { if (myConfigurations.contains(configuration)) { return false; } myConfigurations.add(configuration); myWriteSorted = true; return true; }
addConfiguration
292,822
boolean (@NotNull Collection<? extends Configuration> configurations) { boolean modified = false; for (Configuration configuration : configurations) { modified |= addConfiguration(configuration); } return modified; }
addConfigurations
292,823
boolean (@NotNull Configuration configuration) { final boolean removed = myConfigurations.remove(configuration); if (removed) myWriteSorted = true; return removed; }
removeConfiguration
292,824
boolean (@NotNull String uuid) { final boolean removed = myConfigurations.removeIf(c -> c.getUuid().equals(uuid)); if (removed) myWriteSorted = true; return removed; }
removeConfigurationsWithUuid
292,825
InspectionMetaDataDialog (Project project, @Nullable Configuration configuration) { final List<Configuration> configurations = getConfigurations(); final Function<String, @Nullable @NlsContexts.DialogMessage String> nameValidator = name -> { for (Configuration current : configurations) { if (current.getOrder() == 0 && ...
createMetaDataDialog
292,826
String () { return CommonQuickFixBundle.message("fix.replace.with.x", myReplacementInfo.getReplacement()); }
getName
292,827
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement element = descriptor.getPsiElement(); if (element != null) { myReplacer.replace(myReplacementInfo); } }
applyFix
292,828
String () { //noinspection DialogTitleCapitalization return SSRBundle.message("SSRInspection.family.name"); }
getFamilyName
292,829
void (@NotNull MatchResult result) { if (!duplicates.add(result.getMatchRef())) { return; } registerProblem(result, myConfiguration, myHolder); }
newMatch
292,830
void (@NotNull MatchResult matchResult, @NotNull Configuration configuration, @NotNull ProblemsHolder holder) { final PsiElement element = matchResult.getMatch(); PsiFile containingFile = element.getContainingFile(); PsiFile templateFile = PsiUtilCore.getTemplateLanguageFile(containingFile); if (!element.isPhysical() |...
registerProblem
292,831
void () { duplicates.clear(); }
matchingFinished
292,832
Matcher (@NotNull Configuration configuration, @NotNull Project project) { try { final MatchOptions matchOptions = configuration.getMatchOptions(); final CompiledPattern compiledPattern = PatternCompiler.compilePattern(project, matchOptions, false, true); return (compiledPattern == null) ? null : new Matcher(project, m...
buildCompiledConfiguration
292,833
void (@NotNull Map<Configuration, Matcher> compiledPatterns) { for (Map.Entry<Configuration, Matcher> entry : compiledPatterns.entrySet()) { final Configuration configuration = entry.getKey(); final Matcher matcher = entry.getValue(); if (matcher == null) { myCompiledPatterns.putValue(configuration, Matcher.EMPTY); } e...
checkInCompiledPatterns
292,834
Collection<V> () { return new ConcurrentLinkedDeque<>(); }
createCollection
292,835
void (@NotNull PsiElement element) { if (LexicalNodesFilter.getInstance().accepts(element)) return; for (Map.Entry<Configuration, Matcher> entry : myCompiledOptions.entrySet()) { Matcher matcher = entry.getValue(); if (matcher == null) continue; MatchingStrategy strategy = matcher.getMatchContext().getPattern().getStra...
visitElement
292,836
void (@Nullable PsiElement element, @NotNull Configuration configuration, @NotNull Matcher matcher) { final NodeIterator matchedNodes = SsrFilteringNodeIterator.create(element); if (!matcher.checkIfShouldAttemptToMatch(matchedNodes)) { return; } final MatchContext matchContext = matcher.getMatchContext(); final int nod...
processElement
292,837
String () { return myMainConfiguration.getName(); }
getDisplayName
292,838
String () { return myMainConfiguration.getUuid(); }
getShortName
292,839
boolean () { return true; }
isEnabledByDefault
292,840
boolean () { return isCleanupAllowed() && myMainConfiguration.isCleanup(); }
isCleanup
292,841
boolean () { return ContainerUtil.exists(myConfigurations, c -> c instanceof ReplaceConfiguration); }
isCleanupAllowed
292,842
String () { final HighlightDisplayKey key = HighlightDisplayKey.find(getShortName()); if (key != null) { return key.getID(); // to avoid using a new suppress id before it is registered. } final String suppressId = myMainConfiguration.getSuppressId(); return !StringUtil.isEmpty(suppressId) ? suppressId : SSBasedInspecti...
getID
292,843
String () { return SSBasedInspection.SHORT_NAME; }
getMainToolId
292,844
String () { return SSRBundle.message("structural.search.group.name"); }
getGroupDisplayName
292,845
String () { final String description = myMainConfiguration.getDescription(); if (StringUtil.isEmpty(description)) { return SSRBundle.message("no.description.message"); } return description; }
getStaticDescription
292,846
List<Configuration> () { return Collections.unmodifiableList(myConfigurations); }
getConfigurations
292,847
JComponent () { final MyListModel model = new MyListModel(); final JButton button = new JButton(SSRBundle.message("edit.metadata.button")); button.addActionListener(__ -> performEditMetaData(button)); final JList<Configuration> list = new JBList<>(model) { @Override protected String itemToText(int index, Configuration ...
createOptionsPanel
292,848
String (int index, Configuration value) { return ConfigurationUtil.toXml(value); }
itemToText
292,849
boolean (@NotNull MouseEvent e) { performEdit(list); return true; }
onDoubleClick
292,850
void (@NotNull Component context) { final Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(context)); final InspectionProfileModifiableModel profile = InspectionProfileUtil.getInspectionProfile(context); if (profile == null) { return; } final SSBasedInspection inspection = SSBas...
performEditMetaData
292,851
void (@NotNull JList<Configuration> list, boolean up) { final MyListModel model = (MyListModel)list.getModel(); final List<Configuration> values = list.getSelectedValuesList(); final Comparator<Configuration> c = Comparator.comparingInt(Configuration::getOrder); values.sort(up ? c : c.reversed()); final int[] indices =...
performMove
292,852
Configuration (@NotNull Configuration source, @NotNull Configuration target) { if (source == target) return source; target.setDescription(source.getDescription()); target.setSuppressId(source.getSuppressId()); target.setProblemDescriptor(source.getProblemDescriptor()); target.setCleanup(source.isCleanup()); source.setD...
moveMetaData
292,853
void (@NotNull JList<Configuration> list, @NotNull AnActionButton b) { final AnAction[] children = new AnAction[]{new AddTemplateAction(list, false), new AddTemplateAction(list, true)}; final RelativePoint point = b.getPreferredPopupPoint(); JBPopupFactory.getInstance().createActionGroupPopup(null, new DefaultActionGro...
performAdd
292,854
void (@NotNull JList<Configuration> list) { boolean metaData = false; for (Configuration configuration : list.getSelectedValuesList()) { if (configuration.getOrder() == 0) { metaData = true; } myConfigurations.remove(configuration); } if (metaData) { myMainConfiguration = moveMetaData(myMainConfiguration, myConfigurati...
performRemove
292,855
void (@NotNull JList<Configuration> list) { final Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(list)); if (project == null) return; final int index = list.getSelectedIndex(); if (index < 0) return; final Configuration configuration = myConfigurations.get(index); if (configur...
performEdit
292,856
void (@NotNull JList<Configuration> list) { final InspectionProfileModifiableModel profile = InspectionProfileUtil.getInspectionProfile(list); if (profile == null) return; final SSBasedInspection inspection = SSBasedInspection.getStructuralSearchInspection(profile); inspection.removeConfigurationsWithUuid(myMainConfigu...
saveChangesToProfile
292,857
void (@NotNull AnActionEvent e) { final Project project = e.getData(CommonDataKeys.PROJECT); assert project != null; final SearchContext context = new SearchContext(project); final StructuralSearchDialog dialog = new StructuralSearchDialog(context, myReplace, true); if (!dialog.showAndGet()) return; final Configuration...
actionPerformed
292,858
int () { return myConfigurations.size(); }
getSize
292,859
Configuration (int index) { return myConfigurations.get(index); }
getElementAt
292,860
void (Object source) { fireContentsChanged(source, -1, -1); }
fireContentsChanged
292,861
void (int first, int second) { if (second == -1) return; final Configuration one = myConfigurations.get(first); final Configuration two = myConfigurations.get(second); final int order = one.getOrder(); one.setOrder(two.getOrder()); two.setOrder(order); myConfigurations.set(second, one); myConfigurations.set(first, two)...
swap
292,862
boolean (String typeImage, String typeImage2) { return compareWithNoDifferenceToPackage(typeImage, typeImage2, false); }
compareWithNoDifferenceToPackage
292,863
boolean (String typeImage, @NonNls String typeImage2, boolean ignoreCase) { if (typeImage == null || typeImage2 == null) return Objects.equals(typeImage, typeImage2); final boolean endsWith = ignoreCase ? StringUtil.endsWithIgnoreCase(typeImage2, typeImage) : typeImage2.endsWith(typeImage); return endsWith && ( typeIma...
compareWithNoDifferenceToPackage
292,864
void (@NotNull XmlText text) { myMatchingVisitor.setResult(myMatchingVisitor.getMatchContext().getPattern().isTypedVar(text) ? myMatchingVisitor.handleTypedElement(text, myMatchingVisitor.getElement()) : myMatchingVisitor.matchSequentially(text.getFirstChild(), myMatchingVisitor.getElement().getFirstChild())); }
visitXmlText
292,865
void (@NotNull XmlComment comment) { super.visitXmlComment(comment); final PsiElement element = myMatchingVisitor.getElement(); if (!(element instanceof XmlComment other)) return; final XmlToken text = XmlUtil.getTokenOfType(comment, XmlTokenType.XML_COMMENT_CHARACTERS); assert text != null; final CompiledPattern patte...
visitXmlComment
292,866
XmlToken (XmlTag tag) { PsiElement child = tag.getFirstChild(); while (child != null) { if (child instanceof XmlToken token) { IElementType tokenType = token.getTokenType(); if (tokenType == XmlTokenType.XML_NAME || tokenType == XmlTokenType.XML_TAG_NAME) { // regular xml parser uses XML_NAME, but xml nested in js (JSX...
getTagNameToken
292,867
void (PsiElement node) { myMatchedNodes.add(node); }
addMatchedNode
292,868
void (PsiElement node) { myMatchedNodes.remove(node); }
removeMatchedNode
292,869
void () { mySavedMatchedNodes.push(myMatchedNodes); myMatchedNodes = new SmartList<>(); }
saveMatchedNodes
292,870
void () { myMatchedNodes = mySavedMatchedNodes.tryPop(); }
restoreMatchedNodes
292,871
void () { myMatchedNodes.clear(); }
clearMatchedNodes
292,872
GlobalMatchingVisitor () { return matcher; }
getMatcher
292,873
MatchOptions () { return options; }
getOptions
292,874
void (@NotNull MatchOptions options) { this.options = options; }
setOptions
292,875
MatchResultImpl () { if (previousResults.isEmpty()) { return null; } else { int index = previousResults.size() - 1; MatchResultImpl result = previousResults.get(index); // may contain nulls while (result == null && index > 0) { index--; result = previousResults.get(index); } return result; } }
getPreviousResult
292,876
MatchResultImpl () { if (result==null) result = new MatchResultImpl(); return result; }
getResult
292,877
void () { previousResults.push(result); result = null; }
pushResult
292,878
void () { result = previousResults.pop(); }
popResult
292,879
void (MatchResultImpl result) { this.result = result; if (result == null) { pattern.clearHandlersState(); } }
setResult
292,880
boolean () { return result!=null; }
hasResult
292,881
CompiledPattern () { return pattern; }
getPattern
292,882
void (@NotNull CompiledPattern pattern) { this.pattern = pattern; }
setPattern
292,883
MatchResultSink () { return sink; }
getSink
292,884
void (@NotNull MatchResultSink sink) { this.sink = sink; }
setSink
292,885
void () { result = null; }
clear
292,886
boolean () { return shouldRecursivelyMatch; }
shouldRecursivelyMatch
292,887
void (boolean shouldRecursivelyMatch) { this.shouldRecursivelyMatch = shouldRecursivelyMatch; }
setShouldRecursivelyMatch
292,888
void (@NotNull MatchedElementsListener matchedElementsListener) { myMatchedElementsListenerStack.push(matchedElementsListener); }
pushMatchedElementsListener
292,889
void () { myMatchedElementsListenerStack.pop(); }
popMatchedElementsListener
292,890
void (@NotNull Collection<? extends PsiElement> matchedElements) { if (!myMatchedElementsListenerStack.isEmpty()) { myMatchedElementsListenerStack.peek().matchedElements(matchedElements); } }
notifyMatchedElements
292,891
void () { if (!myMatchedNodes.isEmpty() && !dispatchTargetMatch(getResult())) { dispatchCompleteMatch(); } }
dispatchMatched
292,892
boolean (@NotNull MatchResult result) { boolean dispatched = false; for (MatchResult r : result.getChildren()) { if ((r.isScopeMatch() && !r.isTarget()) || r.isMultipleMatch()) { dispatched |= dispatchTargetMatch(r); } else if (r.isTarget()) { getSink().newMatch(r); dispatched = true; } } return dispatched; }
dispatchTargetMatch
292,893
void () { final MatchResultImpl result = getResult(); final boolean complexMatch = myMatchedNodes.size() > 1; final PsiElement match = myMatchedNodes.get(0); if (!complexMatch) { result.setMatch(match); result.setMatchImage(match.getText()); } else { for (final PsiElement matchStatement : myMatchedNodes) { result.addCh...
dispatchCompleteMatch
292,894
boolean (@NotNull final String str) { return str.trim().startsWith(XML_TYPED_VAR_PREFIX); }
isTypedVar
292,895
String () { return matchImage; }
getMatchImage
292,896
PsiElement () { if (matchRef == null) { return null; } return matchRef.getElement(); }
getMatch
292,897
void (@NotNull SmartPsiElementPointer<?> matchStart) { matchRef = matchStart; }
setMatchRef
292,898
void (PsiElement element) { matchRef = SmartPointerManager.getInstance(element.getProject()).createSmartPsiElementPointer(element); }
setMatch
292,899
String () { return name; }
getName