Do not try to inline properties from decompiled files
This removes GUI freeze for library properties #KT-17234 Fixed
This commit is contained in:
@@ -61,6 +61,9 @@ class KotlinInlineValHandler : InlineActionHandler() {
|
|||||||
val declaration = element as KtProperty
|
val declaration = element as KtProperty
|
||||||
val file = declaration.containingKtFile
|
val file = declaration.containingKtFile
|
||||||
val name = declaration.name ?: return
|
val name = declaration.name ?: return
|
||||||
|
if (file.isCompiled) {
|
||||||
|
return showErrorHint(project, editor, "Cannot inline '$name' from a decompiled file")
|
||||||
|
}
|
||||||
|
|
||||||
val references = ReferencesSearch.search(declaration)
|
val references = ReferencesSearch.search(declaration)
|
||||||
val referenceExpressions = mutableListOf<KtExpression>()
|
val referenceExpressions = mutableListOf<KtExpression>()
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ERROR: Cannot perform refactoring.\nVariable length has no initializer
|
// ERROR: Cannot inline 'length' from a decompiled file
|
||||||
|
|
||||||
fun foo(s: String) {
|
fun foo(s: String) {
|
||||||
val l = s.<caret>length
|
val l = s.<caret>length
|
||||||
|
|||||||
Reference in New Issue
Block a user