Add write action for shorten references in finish template after building call (KT-12056)
Write action was removed in idea 146 #KT-12056 Fixed
This commit is contained in:
+7
-7
@@ -194,7 +194,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
|||||||
ApplicationManager.getApplication().invokeLater { context.showDialogIfNeeded() }
|
ApplicationManager.getApplication().invokeLater { context.showDialogIfNeeded() }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ShortenReferences.DEFAULT.process(elementsToShorten)
|
runWriteAction { ShortenReferences.DEFAULT.process(elementsToShorten) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -992,13 +992,13 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CodeStyleManager.getInstance(project).reformat(newDeclaration)
|
CodeStyleManager.getInstance(project).reformat(newDeclaration)
|
||||||
}
|
|
||||||
|
|
||||||
// change short type names to fully qualified ones (to be shortened below)
|
// change short type names to fully qualified ones (to be shortened below)
|
||||||
val typeRefsToShorten = setupTypeReferencesForShortening(newDeclaration, parameterTypeExpressions)
|
val typeRefsToShorten = setupTypeReferencesForShortening(newDeclaration, parameterTypeExpressions)
|
||||||
if (!transformToJavaMemberIfApplicable(newDeclaration)) {
|
if (!transformToJavaMemberIfApplicable(newDeclaration)) {
|
||||||
elementsToShorten.addAll(typeRefsToShorten)
|
elementsToShorten.addAll(typeRefsToShorten)
|
||||||
setupEditor(newDeclaration)
|
setupEditor(newDeclaration)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user