use of com.intellij.lang.javascript.refactoring.changeSignature.JSParameterInfo in project intellij-plugins by JetBrains.
the class FlexChangeSignatureTest method testIncompatibleImplementation.
public void testIncompatibleImplementation() throws Exception {
myIgnoreConflicts = true;
doTest("foo2", JSAttributeList.AccessType.PUBLIC, "", null, new JSParameterInfo("j", "int", "", "", 0));
}
use of com.intellij.lang.javascript.refactoring.changeSignature.JSParameterInfo in project intellij-plugins by JetBrains.
the class JSCreateMethodActionBase method prepare.
@Override
public Runnable prepare(Object element, DiagramBuilder builder) {
final JSClass clazz = (JSClass) element;
if (!JSRefactoringUtil.checkReadOnlyStatus(clazz, null, getTemplatePresentation().getText()))
return null;
final JSFunction fakeMethod = JSCreateMethodDialog.createFakeMethod(clazz, createFakeMethodText(clazz), false);
final JSCreateMethodDialog dialog = new JSCreateMethodDialog(clazz, fakeMethod, isForceConstructor());
if (!dialog.showAndGet()) {
return null;
}
return () -> {
final JSFunction method = dialog.createMethod();
importType(clazz, dialog.getReturnTypeText());
for (JSParameterInfo param : dialog.getParameters()) {
importType(clazz, param.getTypeText());
}
final PsiElement added = JSRefactoringUtil.addMemberToTargetClass(clazz, method);
final List<FormatFixer> formatters = new ArrayList<>();
formatters.add(FormatFixer.create(added, FormatFixer.Mode.Reformat));
formatters.addAll(ECMAScriptImportOptimizer.executeNoFormat(clazz.getContainingFile()));
FormatFixer.fixAll(FormatFixer.merge(formatters));
};
}
Aggregations