Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
292,300
void (@NotNull Collection<? extends Usage> usages, @NotNull Collection<? extends Usage> excluded) { final List<Usage> sortedUsages = myUsageView.getSortedUsages(); if (sortedUsages.size() == usages.size()) { myUsageView.close(); } else { Usage firstValid = null; Usage select = null; for (Usage usage : sortedUsages) { i...
removeUsagesAndSelectNext
292,301
UsageViewContext () { final Runnable searchStarter = () -> new ReplaceCommand(myConfiguration, mySearchContext).startSearching(); myReplaceUsageViewContext = new ReplaceUsageViewContext(mySearchContext, myConfiguration, searchStarter); return myReplaceUsageViewContext; }
createUsageViewContext
292,302
void (MatchResult result, Usage usage) { super.foundUsage(result, usage); myReplaceUsageViewContext.addReplaceUsage(usage, result); }
foundUsage
292,303
void (VirtualFile file, int start, int end) { removeHighlighter(); editor = FileEditorManager.getInstance(project).openTextEditor(new OpenFileDescriptor(project, file), false); if (editor == null) { return; } myHighlighter = editor.getMarkupModel().addRangeHighlighter( EditorColors.SEARCH_RESULT_ATTRIBUTES, start, end,...
highlight
292,304
void () { if (myHighlighter != null && myHighlighter.isValid()) { myHighlighter.dispose(); myHighlighter = null; editor = null; } }
removeHighlighter
292,305
String () { return "#com.intellij.strucuturalsearch.plugin.replace.ReplacementPreviewDialog"; }
getDimensionServiceKey
292,306
JComponent () { final JComponent centerPanel = new JPanel(new BorderLayout()); final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByFileType(myFileType); assert profile != null; replacement = UIUtil.createEditor(project, myFileType, null, "", false, profile); centerPanel.add(BorderLayout.NORTH, new ...
createCenterPanel
292,307
void () { final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(replacement.getDocument()); if (file != null) { DaemonCodeAnalyzer.getInstance(project).setHighlightingEnabled(file, true); } EditorFactory.getInstance().releaseEditor(replacement); removeHighlighter(); super.dispose(); }
dispose
292,308
ReplaceConfiguration () { return new ReplaceConfiguration(this); }
copy
292,309
ReplaceOptions () { return myReplaceOptions; }
getReplaceOptions
292,310
MatchOptions () { return myReplaceOptions.getMatchOptions(); }
getMatchOptions
292,311
NamedScriptableDefinition (@NotNull String name) { return ObjectUtils.chooseNotNull(myReplaceOptions.getVariableDefinition(name), getMatchOptions().getVariableConstraint(name)); }
findVariable
292,312
void () { myReplaceOptions.removeUnusedVariables(); myReplaceOptions.getMatchOptions().removeUnusedVariables(); }
removeUnusedVariables
292,313
void (Element element) { super.readExternal(element); myReplaceOptions.readExternal(element); }
readExternal
292,314
void (Element element) { super.writeExternal(element); myReplaceOptions.writeExternal(element); }
writeExternal
292,315
boolean (Object configuration) { if (this == configuration) return true; if (!(configuration instanceof ReplaceConfiguration)) return false; if (!super.equals(configuration)) return false; return myReplaceOptions.equals(((ReplaceConfiguration)configuration).myReplaceOptions); }
equals
292,316
int () { return 31 * super.hashCode() + myReplaceOptions.hashCode(); }
hashCode
292,317
String (final String type) { return type.substring(1, type.length() - 1); }
stripTypedVariableDecoration
292,318
int (StringBuilder result, int offset, final ParameterInfo info, String image) { if (!image.isEmpty()) { result.insert(offset + info.getStartIndex(), image); offset += image.length(); } return offset; }
insertSubstitution
292,319
String (String in, String what, String by, ReplaceOptions options, Project project) { return testReplace(in, what, by, options, project, false); }
testReplace
292,320
String (String in, String what, String by, ReplaceOptions options, Project project, boolean sourceIsFile) { final LanguageFileType fileType = options.getMatchOptions().getFileType(); assert fileType != null; return testReplace(in, what, by, options, project, sourceIsFile, false, fileType, fileType.getLanguage()); }
testReplace
292,321
String (String in, String what, String by, ReplaceOptions replaceOptions, Project project, boolean sourceIsFile, boolean createPhysicalFile, @NotNull LanguageFileType sourceFileType, @NotNull Language sourceDialect) { replaceOptions.setReplacement(by); final MatchOptions matchOptions = replaceOptions.getMatchOptions();...
testReplace
292,322
void (final List<? extends ReplacementInfo> infos) { for (ReplacementInfo info : infos) { replaceHandler.prepare(info); } if (IntentionPreviewUtils.isIntentionPreviewActive()) { doReplaceAll(infos, new EmptyProgressIndicator()); } else { ((ApplicationEx)ApplicationManager.getApplication()).runWriteActionWithCancellable...
replaceAll
292,323
void (@NotNull List<? extends ReplacementInfo> infos, @NotNull ProgressIndicator indicator) { indicator.setIndeterminate(false); try { final int size = infos.size(); VirtualFile lastFile = null; for (int i = 0; i < size; i++) { indicator.checkCanceled(); indicator.setFraction((float)(i + 1) / size); final ReplacementIn...
doReplaceAll
292,324
void (@NotNull ReplacementInfo info) { replaceHandler.prepare(info); reformatAndPostProcess(doReplace(info)); }
replace
292,325
PsiElement (@NotNull ReplacementInfo info) { final PsiElement element = info.getMatch(0); if (element==null || !element.isWritable() || !element.isValid()) return null; final PsiElement elementParent = StructuralSearchUtil.getPresentableElement(element).getParent(); CodeStyleManager.getInstance(project).performActionWi...
doReplace
292,326
void (final PsiElement elementParent) { if (elementParent == null || !elementParent.isValid()) return; final PsiFile containingFile = elementParent.getContainingFile(); replaceHandler.postProcess(elementParent, options); if (containingFile != null && options.isToReformatAccordingToStyle()) { final VirtualFile file = co...
reformatAndPostProcess
292,327
void (final PsiElement el, final PsiElement replacement, ReplacementInfo replacementInfo) { final PsiElement lastChild = el.getLastChild(); if (lastChild instanceof PsiComment && replacementInfo.getVariableName(lastChild) == null && !(replacement.getLastChild() instanceof PsiComment)) { PsiElement firstElementAfterStat...
handleComments
292,328
void (@NotNull Project project, @NotNull ReplaceOptions options) { try { final String search = options.getMatchOptions().getSearchPattern(); final String replacement = options.getReplacement(); final Template searchTemplate = TemplateManager.getInstance(project).createTemplate("" , "", search); final Template replaceTe...
checkReplacementPattern
292,329
ReplacementInfo (@NotNull MatchResult result) { final ReplacementInfoImpl replacementInfo = new ReplacementInfoImpl(result, project); final LanguageFileType fileType = options.getMatchOptions().getFileType(); assert fileType != null; replacementInfo.setReplacement(replacementBuilder.process(result, replacementInfo, fil...
buildReplacement
292,330
PsiElement (@NotNull PsiElement elementToReplace, PsiElement @NotNull [] patternElements, @NotNull String replacementToMake, @NotNull PsiElement elementParent) { int i = 0; while (true) { // if it goes out of bounds then deep error happens if (!(patternElements[i] instanceof PsiComment || patternElements[i] instanceof ...
copySpacesAndCommentsBefore
292,331
void (@NotNull PsiElement element) { final String text = element.getText(); if (MatchUtil.isTypedVariable(text)) { final Collection<ParameterInfo> infos = findParameterization(Replacer.stripTypedVariableDecoration(text)); for (ParameterInfo info : infos) { if (info.getElement() == null) { info.setElement(element); retu...
visitElement
292,332
Object (@NotNull ParameterInfo info, @NotNull MatchResult match) { ScriptSupport scriptSupport = replacementVarsMap.get(info.getName()); if (scriptSupport == null) { final String constraint = options.getVariableDefinition(info.getName()).getScriptCodeConstraint(); final List<String> variableNames = ContainerUtil.map(op...
generateReplacement
292,333
Collection<ParameterInfo> (String name) { return parameterizations.get(name); }
findParameterization
292,334
ParameterInfo (PsiElement element) { if (element == null) return null; final String text = element.getText(); if (!MatchUtil.isTypedVariable(text)) return null; return ContainerUtil.find(findParameterization(Replacer.stripTypedVariableDecoration(text)), info -> info.getElement() == element); }
findParameterization
292,335
void (@NotNull Project project) { fillPointerList(project); fillVariableMap(matchResult.getRoot()); for(Map.Entry<String, MatchResult> entry : variableMap.entrySet()) { fillElementToVariableNameMap(entry.getKey(), entry.getValue()); } }
init
292,336
String () { return replacement; }
getReplacement
292,337
void (@NotNull String replacement) { this.replacement = replacement; }
setReplacement
292,338
PsiElement (int index) { return matchesPtrList.get(index).getElement(); }
getMatch
292,339
int () { return matchesPtrList.size(); }
getMatchesCount
292,340
MatchResult (@NotNull String name) { return variableMap.get(name); }
getNamedMatchResult
292,341
MatchResult () { return matchResult; }
getMatchResult
292,342
String (@NotNull PsiElement element) { return elementToVariableNameMap.get(element); }
getVariableName
292,343
String (@NotNull String sourceName) { return sourceNameToSearchPatternNameMap.get(sourceName); }
getSearchPatternName
292,344
void (@NotNull Project project) { final SmartPointerManager manager = SmartPointerManager.getInstance(project); if (MatchResult.MULTI_LINE_MATCH.equals(matchResult.getName())) { final Iterator<MatchResult> i = matchResult.getChildren().iterator(); while (i.hasNext()) { final MatchResult r = i.next(); if (MatchResult.LI...
fillPointerList
292,345
void (final String name, final MatchResult matchResult) { final boolean multiMatch = matchResult.isMultipleMatch() || matchResult.isScopeMatch(); if (matchResult.hasChildren() && multiMatch) { for (MatchResult r : matchResult.getChildren()) { fillElementToVariableNameMap(name, r); } } else if (!multiMatch) { final PsiE...
fillElementToVariableNameMap
292,346
void (MatchResult r) { final String name = r.getName(); if (name != null) { variableMap.putIfAbsent(name, r); sourceNameToSearchPatternNameMap.put(r.getMatchImage(), name); } if (!r.isScopeMatch() || !r.isMultipleMatch()) { for (final MatchResult matchResult : r.getChildren()) { fillVariableMap(matchResult); } } else i...
fillVariableMap
292,347
String () { return name; }
getName
292,348
int () { return startIndex; }
getStartIndex
292,349
boolean () { return argumentContext; }
isArgumentContext
292,350
void (boolean argumentContext) { this.argumentContext = argumentContext; }
setArgumentContext
292,351
boolean () { return statementContext; }
isStatementContext
292,352
void (boolean statementContext) { this.statementContext = statementContext; }
setStatementContext
292,353
int () { return afterDelimiterPos; }
getAfterDelimiterPos
292,354
void (int afterDelimiterPos) { this.afterDelimiterPos = afterDelimiterPos; }
setAfterDelimiterPos
292,355
boolean () { return hasCommaBefore; }
isHasCommaBefore
292,356
void (boolean hasCommaBefore) { this.hasCommaBefore = hasCommaBefore; }
setHasCommaBefore
292,357
int () { return beforeDelimiterPos; }
getBeforeDelimiterPos
292,358
void (int beforeDelimiterPos) { this.beforeDelimiterPos = beforeDelimiterPos; }
setBeforeDelimiterPos
292,359
boolean () { return hasCommaAfter; }
isHasCommaAfter
292,360
void (boolean hasCommaAfter) { this.hasCommaAfter = hasCommaAfter; }
setHasCommaAfter
292,361
boolean () { return replacementVariable; }
isReplacementVariable
292,362
PsiElement () { return myElement; }
getElement
292,363
void (@NotNull PsiElement element) { myElement = element; }
setElement
292,364
void (@NotNull AnActionEvent e) { Configuration configuration = myConfigurationProducer.get(); if (ConfigurationManager.getInstance(project).showSaveTemplateAsDialog(configuration)) { reloadUserTemplates(configurationManager); DefaultMutableTreeNode node = TreeUtil.findNodeWithObject(myUserTemplatesNode, configuration)...
actionPerformed
292,365
void (@NotNull AnActionEvent e) { StructuralSearchProfileActionProvider.createNewInspection(myConfigurationProducer.get(), project); }
actionPerformed
292,366
void (@NotNull AnActionEvent e) { final DefaultMutableTreeNode selectedNode = getSelectedNode(); boolean enabled = selectedNode != null && selectedNode.getUserObject() instanceof Configuration && selectedNode.isNodeAncestor(myUserTemplatesNode); e.getPresentation().setEnabled(enabled); }
update
292,367
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
292,368
void (@NotNull AnActionEvent e) { removeTemplate(project); }
actionPerformed
292,369
TreeState () { return TreeState.createOn(patternTree, true, true); }
getTreeState
292,370
void (TreeState treeState) { if (treeState == null) { TreeUtil.expandAll(patternTree); } else { treeState.applyTo(patternTree); } }
setTreeState
292,371
void (ConfigurationManager configurationManager) { myProjectTemplatesNode.removeAllChildren(); myUserTemplatesNode.removeAllChildren(); for (Configuration config : configurationManager.getIdeConfigurations()) { myUserTemplatesNode.add(new DefaultMutableTreeNode(config)); } List<Configuration> projectConfigurations = co...
reloadUserTemplates
292,372
void (Project project) { final Object selection = patternTree.getLastSelectedPathComponent(); if (!(selection instanceof DefaultMutableTreeNode node)) { return; } if (!(node.getUserObject() instanceof Configuration configuration)) { return; } if (configuration.isPredefined()) { return; } if (((DefaultMutableTreeNode)se...
removeTemplate
292,373
void (LanguageFileType fileType) { final var root = (DefaultMutableTreeNode) patternTreeModel.getRoot(); final Enumeration<TreeNode> children = root.children(); while (children.hasMoreElements()) { final var node = (DefaultMutableTreeNode) children.nextElement(); for (String lang : node.toString().split("/")) { if (lan...
selectFileType
292,374
void () { if (!myTemplateChanged) { myTemplateChanged = true; if (!myDraftTemplateNode.equals(getSelectedNode())) { myDraftTemplateAutoselect = true; TreeUtil.selectInTree(myDraftTemplateNode, false, patternTree, true); myDraftTemplateAutoselect = false; } } }
templateChanged
292,375
DefaultMutableTreeNode (@NotNull DefaultMutableTreeNode root, String[] path) { DefaultMutableTreeNode result = root; outer: for (String step : path) { step = StringUtil.replace(step, "//", "/"); DefaultMutableTreeNode child = (result.getChildCount() == 0) ? null : (DefaultMutableTreeNode)result.getLastChild(); while (c...
getOrCreateCategoryNode
292,376
DefaultMutableTreeNode () { final Object selection = patternTree.getLastSelectedPathComponent(); if (!(selection instanceof DefaultMutableTreeNode)) { return null; } return (DefaultMutableTreeNode)selection; }
getSelectedNode
292,377
Tree (TreeModel treeModel) { final Tree tree = new Tree(treeModel); tree.setRootVisible(false); tree.setShowsRootHandles(true); tree.setDragEnabled(false); tree.setEditable(false); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.setTransferHandler(new TransferHandler() { @Nulla...
createTree
292,378
Transferable (JComponent c) { final Object selection = tree.getLastSelectedPathComponent(); if (!(selection instanceof DefaultMutableTreeNode node)) { return null; } if (!(node.getUserObject() instanceof Configuration)) { return null; } return new TextTransferable(ConfigurationUtil.toXml((Configuration)node.getUserObje...
createTransferable
292,379
int (JComponent c) { return COPY; }
getSourceActions
292,380
JComponent () { return panel; }
getTemplatesPanel
292,381
void (@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { final DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)value; final Object userObject = treeNode.getUserObject(); if (userObject == null && treeNode != myDraftNode) return; final Color backgr...
customizeCellRenderer
292,382
void (Consumer<? super Configuration> consumer) { patternTree.addTreeSelectionListener(event -> { final var selection = patternTree.getLastSelectedPathComponent(); if (!(selection instanceof DefaultMutableTreeNode) || myDraftTemplateAutoselect) { return; } if (myTemplateChanged) { myDraftTemplateNode.setUserObject(myCo...
onConfigurationSelected
292,383
void (Supplier<? extends Configuration> configurationProducer) { myConfigurationProducer = configurationProducer; }
setConfigurationProducer
292,384
void () { myScrollPane.setBorder(JBUI.Borders.customLineTop(JBUI.CurrentTheme.Editor.BORDER_COLOR)); }
updateColors
292,385
void (@NotNull UsageView usageView) { myUsageView = usageView; final MessageBusConnection connection = mySearchContext.getProject().getMessageBus().connect(usageView); connection.subscribe(DynamicPluginListener.TOPIC, new DynamicPluginListener() { @Override public void beforePluginUnload(@NotNull IdeaPluginDescriptor p...
setUsageView
292,386
void (@NotNull IdeaPluginDescriptor pluginDescriptor, boolean isUpdate) { myUsageView.close(); }
beforePluginUnload
292,387
ConfigurableUsageTarget () { return myTarget; }
getTarget
292,388
void (@NotNull UsageViewPresentation presentation) { final String pattern = myConfiguration.getMatchOptions().getSearchPattern(); final SearchScope scope = myConfiguration.getMatchOptions().getScope(); assert scope != null; final String scopeText = scope.getDisplayName(); presentation.setScopeText(scopeText); final Str...
configure
292,389
void () { myUsageView.addButtonToLowerPane(new AbstractAction(SSRBundle.message("create.inspection.from.template.action.text")) { @Override public void actionPerformed(ActionEvent e) { StructuralSearchProfileActionProvider.createNewInspection(myConfiguration.copy(), mySearchContext.getProject()); } }); }
configureActions
292,390
void (ActionEvent e) { StructuralSearchProfileActionProvider.createNewInspection(myConfiguration.copy(), mySearchContext.getProject()); }
actionPerformed
292,391
PsiElement (PsiManager psiManager, Object object, PsiElement element) { if (object instanceof Configuration) { return new ConfigurationElement((Configuration)object, psiManager); } return null; }
getDocumentationElementForLookupItem
292,392
Configuration () { return myConfiguration; }
getConfiguration
292,393
PsiElement () { return myDummyHolder; }
getParent
292,394
ItemPresentation () { return new ItemPresentation() { @Override public String getPresentableText() { return myConfiguration.getName(); } @Nullable @Override public Icon getIcon(boolean unused) { return null; } }; }
getPresentation
292,395
String () { return myConfiguration.getName(); }
getPresentableText
292,396
Icon (boolean unused) { return null; }
getIcon
292,397
PsiManager () { return myPsiManager; }
getManager
292,398
void (@Nullable Consumer<? super FileTypeInfo> consumer) { myConsumer = consumer; }
setFileTypeInfoConsumer
292,399
void (@Nullable Consumer<? super FileTypeInfo> consumer) { myUserActionConsumer = consumer; }
setUserActionFileTypeInfoConsumer