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:
Nikolay Krasko
2016-04-26 17:37:01 +03:00
parent 30e8c67d01
commit a6d129b006
@@ -194,7 +194,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
ApplicationManager.getApplication().invokeLater { context.showDialogIfNeeded() }
}
else {
ShortenReferences.DEFAULT.process(elementsToShorten)
runWriteAction { ShortenReferences.DEFAULT.process(elementsToShorten) }
}
}
@@ -992,13 +992,13 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
}
CodeStyleManager.getInstance(project).reformat(newDeclaration)
}
// change short type names to fully qualified ones (to be shortened below)
val typeRefsToShorten = setupTypeReferencesForShortening(newDeclaration, parameterTypeExpressions)
if (!transformToJavaMemberIfApplicable(newDeclaration)) {
elementsToShorten.addAll(typeRefsToShorten)
setupEditor(newDeclaration)
// change short type names to fully qualified ones (to be shortened below)
val typeRefsToShorten = setupTypeReferencesForShortening(newDeclaration, parameterTypeExpressions)
if (!transformToJavaMemberIfApplicable(newDeclaration)) {
elementsToShorten.addAll(typeRefsToShorten)
setupEditor(newDeclaration)
}
}
}
finally {