Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
54,100
void ( @Nullable KtFile targetFile, @Nullable PsiDirectory targetDirectory, @NotNull Set<KtNamedDeclaration> elementsToMove, @NotNull List<KtFile> sourceFiles ) { PsiDirectory sourceDir = sourceFiles.get(0).getParent(); if (sourceDir == null) { throw new AssertionError("File chooser initialization failed"); } Module ta...
initFileChooser
54,101
void () { classPackageChooser = createPackageChooser(); destinationFolderCB = new KotlinDestinationFolderComboBox() { @Override public String getTargetPackage() { return MoveKotlinTopLevelDeclarationsDialog.this.getTargetPackage(); } @Override protected boolean sourceRootsInTargetDirOnly() { return !freezeTargets; } };...
createUIComponents
54,102
String () { return MoveKotlinTopLevelDeclarationsDialog.this.getTargetPackage(); }
getTargetPackage
54,103
boolean () { return !freezeTargets; }
sourceRootsInTargetDirOnly
54,104
ReferenceEditorComboWithBrowseButton () { return new PackageNameReferenceEditorCombo( "", myProject, RECENTS_KEY, RefactoringBundle.message("choose.destination.package") ); }
createPackageChooser
54,105
boolean (List<KtNamedDeclaration> declarations) { for (KtNamedDeclaration element : declarations) { if (ExpectActualUtilKt.isEffectivelyActual(element, true) || ExpectActualUtilKt.isExpectDeclaration(element)) { return true; } } return false; }
isMPPDeclarationInList
54,106
boolean () { return isMPPDeclarationInList(getSelectedElementsToMove()); }
isMppDeclarationSelected
54,107
void () { boolean mppDeclarationSelected = isMppDeclarationSelected(); cbApplyMPPDeclarationsMove.setEnabled(mppDeclarationSelected); boolean needToMoveMPPDeclarations = mppDeclarationSelected && cbApplyMPPDeclarationsMove.isSelected(); if (needToMoveMPPDeclarations) { if (!rbMoveToPackage.isSelected()) { rbMoveToPacka...
updateControls
54,108
boolean () { return !getSuitableDestinationSourceRoots(myProject).isEmpty(); }
hasAnySourceRoots
54,109
void () { KotlinRefactoringSettings refactoringSettings = KotlinRefactoringSettings.getInstance(); refactoringSettings.MOVE_SEARCH_IN_COMMENTS = cbSearchInComments.isSelected(); refactoringSettings.MOVE_SEARCH_FOR_TEXT = cbSearchTextOccurrences.isSelected(); refactoringSettings.MOVE_DELETE_EMPTY_SOURCE_FILES = cbDelete...
saveRefactoringSettings
54,110
List<KtNamedDeclaration> () { return CollectionsKt.map( memberTable.getSelectedMemberInfos(), MemberInfoBase::getMember ); }
getSelectedElementsToMove
54,111
JComponent () { return mainPanel; }
createCenterPanel
54,112
String () { return "#" + getClass().getName(); }
getDimensionServiceKey
54,113
String () { return classPackageChooser.getText().trim(); }
getTargetPackage
54,114
void () { ModelResultWithFUSData modelResult; try { modelResult = getModel().computeModelResult(); } catch (ConfigurationException e) { setErrorHtml(e.getMessageHtml()); return; } saveRefactoringSettings(); try { MoveUtilKt.logFusForMoveRefactoring( modelResult.getElementsCount(), modelResult.getEntityToMove(), modelRe...
doAction
54,115
JComponent () { return classPackageChooser.getChildComponent(); }
getPreferredFocusedComponent
54,116
void () { parameterField = new NameSuggestionsField(project); packageNameField = new PackageNameReferenceEditorCombo("", project, RECENTS_KEY, RefactoringBundle.message("choose.destination.package")); }
createUIComponents
54,117
String () { return KotlinBundle.message("text.nested.classes.to.upper.level"); }
getMovePropertySuffix
54,118
String () { return HelpID.MOVE_INNER_UPPER; }
getHelpId
54,119
String () { return KotlinBundle.message("checkbox.text.open.moved.files.in.editor"); }
getCbTitle
54,120
String () { return classNameField.getText().trim(); }
getClassName
54,121
String () { return parameterField != null ? parameterField.getEnteredName() : null; }
getParameterName
54,122
boolean () { return innerClass instanceof KtClass && MoveUtilKt.traverseOuterInstanceReferences(innerClass, true); }
isThisNeeded
54,123
FqName () { return MoveUtilKt.getTargetPackageFqName(targetContainer); }
getTargetPackageFqName
54,124
KotlinType () { return ((ClassDescriptor) innerClassDescriptor.getContainingDeclaration()).getDefaultType(); }
getOuterInstanceType
54,125
BitSet (boolean applyDefaults) { BitSet state = new BitSet(3); state.set(0, !applyDefaults && searchInCommentsCheckBox.isSelected()); //searchInCommentsCheckBox default is false state.set(1, !applyDefaults && searchForTextOccurrencesCheckBox.isSelected()); //searchForTextOccurrencesCheckBox default is false state.set(2...
getCheckboxesState
54,126
void () { classNameField.setText(innerClass.getName()); classNameField.selectAll(); if (innerClass instanceof KtClass && ((KtClass) innerClass).isInner()) { passOuterClassCheckBox.setSelected(true); passOuterClassCheckBox.addItemListener(e -> parameterField.setEnabled(passOuterClassCheckBox.isSelected())); } else { pas...
init
54,127
JComponent () { return classNameField; }
getPreferredFocusedComponent
54,128
String () { return "#com.intellij.refactoring.move.moveInner.MoveInnerDialog"; }
getDimensionServiceKey
54,129
JComponent () { return panel; }
createNorthPanel
54,130
JComponent () { return null; }
createCenterPanel
54,131
VirtualFile ( @NotNull PackageWrapper newPackage, @NotNull List<? extends VirtualFile> contentSourceRoots, @Nullable PsiDirectory initialDir ) { return CommonMoveClassesOrPackagesUtil.chooseSourceRoot(newPackage, contentSourceRoots, initialDir); }
chooseSourceRoot
54,132
Model () { return new MoveKotlinNestedClassesToUpperLevelModelWithUIChooser( project, innerClass, targetContainer, getParameterName(), getClassName(), passOuterClassCheckBox.isSelected(), searchInCommentsCheckBox.isSelected(), searchForTextOccurrencesCheckBox.isSelected(), packageNameField.getText(), isOpenInEditor() )...
getModel
54,133
void () { ModelResultWithFUSData modelResult; try { modelResult = getModel().computeModelResult(); } catch (ConfigurationException e) { setErrorHtml(e.getMessageHtml()); return; } KotlinRefactoringSettings settings = KotlinRefactoringSettings.getInstance(); settings.MOVE_TO_UPPER_LEVEL_SEARCH_FOR_TEXT = searchForTextOc...
doAction
54,134
int () { return openInEditorCheckBox.isSelected() ? 1 : 0; }
getCheckboxesState
54,135
void (@NotNull KtClassOrObject initialTargetClass) { //noinspection ConstantConditions originalClassField.setText(originalClass.getFqName().asString()); //noinspection ConstantConditions targetClassChooser = new KotlinTypeReferenceEditorComboWithBrowseButton( new ActionListener() { @Override public void actionPerformed...
initClassChooser
54,136
void (ActionEvent e) { TreeClassChooser chooser = new TreeJavaClassChooserDialog( RefactoringBundle.message("choose.destination.class"), myProject, searchScope, MoveKotlinNestedClassesDialog.this::classMatchesFilter, null, null, true ) { @Nullable @Override protected PsiClass getSelectedFromTreeUserObject(DefaultMutabl...
actionPerformed
54,137
PsiClass (DefaultMutableTreeNode node) { PsiClass psiClass = super.getSelectedFromTreeUserObject(node); if (psiClass != null) return psiClass; Object userObject = node.getUserObject(); if (!(userObject instanceof KtClassOrObjectTreeNode)) return null; return LightClassUtilsKt.toLightClass(((KtClassOrObjectTreeNode) use...
getSelectedFromTreeUserObject
54,138
void (@NotNull DocumentEvent e) { PsiClass aClass = JavaPsiFacade .getInstance(myProject) .findClass(targetClassChooser.getText(), searchScope); targetClass = aClass instanceof KtLightClassForSourceDeclaration ? ((KtLightClassForSourceDeclaration) aClass).getKotlinOrigin() : aClass; validateButtons(); }
documentChanged
54,139
boolean (PsiClass aClass) { if (!searchScope.accept(aClass.getContainingFile().getVirtualFile())) return false; if (targetDirectory != null) { PsiPackage targetPackage = JavaDirectoryService.getInstance().getPackage(targetDirectory); if (targetPackage != null) { PsiDirectory directory = aClass.getContainingFile().getCo...
classMatchesFilter
54,140
void (@NotNull List<KtClassOrObject> elementsToMove) { List<KotlinMemberInfo> memberInfos = CollectionsKt.mapNotNull( originalClass.getDeclarations(), declaration -> { if (!(declaration instanceof KtClassOrObject classOrObject)) return null; if (classOrObject instanceof KtClass && ((KtClass) classOrObject).isInner()) r...
initMemberInfo
54,141
List<KtClassOrObject> () { return CollectionsKt.map( memberTable.getSelectedMemberInfos(), info -> (KtClassOrObject) info.getMember() ); }
getSelectedElementsToMove
54,142
JComponent () { return mainPanel; }
createCenterPanel
54,143
String () { return "#" + getClass().getName(); }
getDimensionServiceKey
54,144
Model () { return new MoveKotlinNestedClassesModel( myProject, openInEditorCheckBox.isSelected(), getSelectedElementsToMove(), originalClass, targetClass, moveCallback); }
getModel
54,145
void () { ModelResultWithFUSData modelResult; try { modelResult = getModel().computeModelResult(); } catch (ConfigurationException e) { setErrorHtml(e.getMessageHtml()); return; } MoveUtilKt.logFusForMoveRefactoring( modelResult.getElementsCount(), modelResult.getEntityToMove(), modelResult.getDestination(), getCheckbo...
doAction
54,146
JComponent () { return targetClassChooser.getChildComponent(); }
getPreferredFocusedComponent
54,147
void () { if (toClassRadioButton.isSelected()) selectedTarget = targetVariableList.getSelectedValue(); if (toObjectRadioButton.isSelected() && selectedTarget == null) { setErrorText(KotlinBundle.message("text.no.destination.object.specified")); return; } Map<KtClass, String> oldClassParameterNames = new LinkedHashMap<>...
doAction
54,148
JComponent () { return mainPanel; }
createCenterPanel
54,149
void () { toClassRadioButton.addActionListener(e -> enableTargetChooser()); toObjectRadioButton.addActionListener(e -> enableTargetChooser()); if (variables.length != 0 && !(targetContainer instanceof KtObjectDeclaration)) { toClassRadioButton.setSelected(true); } else { toObjectRadioButton.setSelected(true); if (varia...
initButtons
54,150
void () { AbstractListModel<KtNamedDeclaration> listModel = new AbstractListModel<>() { @Override public int getSize() { return variables.length; } @Override public KtNamedDeclaration getElementAt(int index) { return variables[index]; } }; targetVariableList = new JBList<>(listModel); DefaultListCellRenderer listCellRe...
initTargetVariableList
54,151
int () { return variables.length; }
getSize
54,152
KtNamedDeclaration (int index) { return variables[index]; }
getElementAt
54,153
Component ( JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus ) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (value instanceof KtNamedDeclaration variable) { setIcon(KotlinIconProvider.Companion.getBaseIcon(variable)); setText(variable.getName());...
getListCellRendererComponent
54,154
void () { targetObjectChooser = new KotlinTypeReferenceEditorComboWithBrowseButton( e -> { TreeClassChooser chooser = createTreeClassChooser(); chooser.selectDirectory(method.getContainingFile().getContainingDirectory()); chooser.showDialog(); PsiClass psiClass = chooser.getSelected(); if (psiClass instanceof KtLightCl...
initTargetObjectChooser
54,155
void () { for (EditorTextField textField : oldClassParameterNameFields.values()) { textField.setEnabled(true); } if (toClassRadioButton.isSelected()) { KtNamedDeclaration variable = variables[targetVariableList.getSelectedIndex()]; KtClassOrObject containingClass = KtPsiUtilKt.getContainingClassOrObject(variable); if (...
enableTextFields
54,156
void () { if (toClassRadioButton.isSelected()) { targetVariableList.setEnabled(true); targetObjectChooser.setEnabled(false); } else { targetVariableList.setEnabled(false); targetObjectChooser.setEnabled(true); } enableTextFields(); }
enableTargetChooser
54,157
void () { if (thisClassesToMembers.isEmpty()) return; parametersPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, true)); Fe10KotlinNewDeclarationNameValidator validator = new Fe10KotlinNewDeclarationNameValidator( (PsiElement) method, null, KotlinNameSuggestionProvider.ValidatorTarget.PARAMETE...
initParametersPanel
54,158
TreeJavaClassChooserDialog () { return new TreeJavaClassChooserDialog( KotlinBundle.message("title.choose.destination.object"), myProject, GlobalSearchScope.projectScope(myProject), aClass -> { if (!(aClass instanceof KtLightClassForSourceDeclaration)) return false; KtClassOrObject ktClassOrObject = ((KtLightClassForSo...
createTreeClassChooser
54,159
PsiClass (DefaultMutableTreeNode node) { PsiClass psiClass = super.getSelectedFromTreeUserObject(node); if (psiClass != null) return psiClass; Object userObject = node.getUserObject(); if (!(userObject instanceof KtClassOrObjectTreeNode)) return null; return LightClassUtilsKt.toLightClass(((KtClassOrObjectTreeNode) use...
getSelectedFromTreeUserObject
54,160
void () { this.signaturePreviewField = new KotlinSignatureComponent("", project); }
createUIComponents
54,161
boolean () { return ExtractableAnalysisUtilKt.isVisibilityApplicable(originalDescriptor.getDescriptor().getExtractionData()); }
isVisibilitySectionAvailable
54,162
String () { return KtPsiUtilKt.quoteIfNeeded(functionNameField.getEnteredName()); }
getFunctionName
54,163
KtModifierKeywordToken () { if (!isVisibilitySectionAvailable()) return null; KtModifierKeywordToken value = (KtModifierKeywordToken) visibilityBox.getSelectedItem(); return KtTokens.DEFAULT_VISIBILITY_KEYWORD.equals(value) ? null : value; }
getVisibility
54,164
boolean () { if (!KtPsiUtilKt.isIdentifier(getFunctionName())) return false; for (ExtractFunctionParameterTablePanel.ParameterInfo parameterInfo : parameterTablePanel.getSelectedParameterInfos()) { if (!KtPsiUtilKt.isIdentifier(parameterInfo.getName())) return false; } return true; }
checkNames
54,165
void () { this.currentDescriptor = createDescriptor(); setOKActionEnabled(checkNames()); signaturePreviewField.setText( ExtractorUtilKt.getSignaturePreview(getCurrentConfiguration(), IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_ANNOTATIONS) ); }
update
54,166
void () { super.init(); ExtractableCodeDescriptor extractableCodeDescriptor = originalDescriptor.getDescriptor(); functionNameField = new NameSuggestionsField( ArrayUtil.toStringArray(extractableCodeDescriptor.getSuggestedNames()), project, KotlinFileType.INSTANCE ); functionNameField.addDataChangedListener(() -> updat...
init
54,167
Component ( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus ) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); @NlsSafe String text = IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_ANNOTATIONS.renderType((KotlinType) value); setText(text); return this;...
getListCellRendererComponent
54,168
void (@NotNull ItemEvent e) { update(); }
itemStateChanged
54,169
void (@NotNull ItemEvent e) { update(); }
itemStateChanged
54,170
void () { KotlinExtractFunctionDialog.this.update(); }
updateSignature
54,171
void () { doOKAction(); }
onEnterAction
54,172
void () { doCancelAction(); }
onCancelAction
54,173
void () { nonBlocking( project, () -> { try { return ExtractableAnalysisUtilKt.validate(currentDescriptor); } catch (RuntimeException e) { return new ExtractableCodeDescriptorWithException(e); } }, result -> { if (result instanceof ExtractableCodeDescriptorWithException) { throw ((ExtractableCodeDescriptorWithException...
doOKAction
54,174
Unit () { close(OK_EXIT_CODE); return Unit.INSTANCE; }
invoke
54,175
Unit () { KotlinExtractFunctionDialog.super.doOKAction(); return onAccept.invoke(KotlinExtractFunctionDialog.this); }
invoke
54,176
JComponent () { return functionNameField.getFocusableComponent(); }
getPreferredFocusedComponent
54,177
JComponent () { return contentPane; }
createCenterPanel
54,178
JComponent () { return contentPane; }
createContentPane
54,179
ExtractableCodeDescriptor () { return createNewDescriptor(originalDescriptor.getDescriptor(), getFunctionName(), getVisibility(), parameterTablePanel.getSelectedReceiverInfo(), parameterTablePanel.getSelectedParameterInfos(), (KotlinType) returnTypeBox.getSelectedItem()); }
createDescriptor
54,180
ExtractionGeneratorConfiguration () { return new ExtractionGeneratorConfiguration(currentDescriptor, ExtractionGeneratorOptions.DEFAULT); }
getCurrentConfiguration
54,181
ExtractableCodeDescriptor ( @NotNull ExtractableCodeDescriptor originalDescriptor, @NotNull String newName, @Nullable KtModifierKeywordToken newVisibility, @Nullable ExtractFunctionParameterTablePanel.ParameterInfo newReceiverInfo, @NotNull List<ExtractFunctionParameterTablePanel.ParameterInfo> newParameterInfos, @Null...
createNewDescriptor
54,182
void () { this.signaturePreviewField = new KotlinSignatureComponent("", project); }
createUIComponents
54,183
boolean () { return !getApplicableVisibilities().isEmpty(); }
isVisibilitySectionAvailable
54,184
List<KtModifierKeywordToken> () { return IntroduceTypeAliasImplKt.getApplicableVisibilities(originalDescriptor.getOriginalData()); }
getApplicableVisibilities
54,185
String () { return KtPsiUtilKt.quoteIfNeeded(aliasNameField.getEnteredName()); }
getAliasName
54,186
KtModifierKeywordToken () { if (!isVisibilitySectionAvailable()) return null; return (KtModifierKeywordToken) visibilityBox.getSelectedItem(); }
getVisibility
54,187
boolean () { if (!KtPsiUtilKt.isIdentifier(getAliasName())) return false; if (parameterTablePanel != null) { for (IntroduceTypeAliasParameterTablePanel.TypeParameterInfo parameterInfo : parameterTablePanel.getSelectedTypeParameterInfos()) { if (!KtPsiUtilKt.isIdentifier(parameterInfo.getName())) return false; } } retur...
checkNames
54,188
void () { this.currentDescriptor = createDescriptor(); setOKActionEnabled(checkNames()); signaturePreviewField.setText(IntroduceTypeAliasImplKt.generateTypeAlias(currentDescriptor, true).getText()); }
update
54,189
void () { super.init(); visibilityBox.setModel(new DefaultComboBoxModel<>(getApplicableVisibilities().toArray(new KtModifierKeywordToken[0]))); visibilityBox.setRenderer( new DefaultListCellRenderer() { @Override public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boo...
init
54,190
Component ( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus ) { @NlsSafe String tokenValue = value != null ? ((KtModifierKeywordToken) value).getValue() : null; return super.getListCellRendererComponent(list, tokenValue, index, isSelected, cellHasFocus); }
getListCellRendererComponent
54,191
void (@NotNull ItemEvent e) { update(); }
itemStateChanged
54,192
void () { KotlinIntroduceTypeAliasDialog.this.update(); }
updateSignature
54,193
void () { doOKAction(); }
onEnterAction
54,194
void () { doCancelAction(); }
onCancelAction
54,195
void () { MultiMap<PsiElement, String> conflicts = IntroduceTypeAliasImplKt.validate(currentDescriptor).getConflicts(); KotlinRefactoringUtilKt.checkConflictsInteractively( project, conflicts, new Function0<>() { @Override public Unit invoke() { close(OK_EXIT_CODE); return Unit.INSTANCE; } }, new Function0<>() { @Overr...
doOKAction
54,196
Unit () { close(OK_EXIT_CODE); return Unit.INSTANCE; }
invoke
54,197
Unit () { KotlinIntroduceTypeAliasDialog.super.doOKAction(); return onAccept.invoke(KotlinIntroduceTypeAliasDialog.this); }
invoke
54,198
JComponent () { return aliasNameField; }
getPreferredFocusedComponent
54,199
JComponent () { return contentPane; }
createCenterPanel