Unify message bundles used in IDEA FIR into KotlinBundle
This commit is contained in:
+73
@@ -2225,3 +2225,76 @@ hints.codevision.overrides.format={0, choice, 1#1 Override|2#{0,number} Override
|
|||||||
hints.codevision.overrides.to_many.format={0,number}+ Overrides
|
hints.codevision.overrides.to_many.format={0,number}+ Overrides
|
||||||
hints.codevision.settings=Settings...
|
hints.codevision.settings=Settings...
|
||||||
inspection.unused.result.of.data.class.copy=Unused result of data class copy
|
inspection.unused.result.of.data.class.copy=Unused result of data class copy
|
||||||
|
|
||||||
|
|
||||||
|
find.declaration.implementing.methods.checkbox=&Implementing functions
|
||||||
|
find.declaration.overriding.methods.checkbox=Over&riding functions
|
||||||
|
find.declaration.implementing.properties.checkbox=&Implementing properties
|
||||||
|
find.declaration.overriding.properties.checkbox=Over&riding properties
|
||||||
|
find.declaration.property.readers.checkbox=Readers
|
||||||
|
find.declaration.property.writers.checkbox=Writers
|
||||||
|
find.declaration.include.overloaded.methods.checkbox=Include o&verloaded functions and extensions
|
||||||
|
find.declaration.functions.usages.checkbox=Usages of &functions
|
||||||
|
find.declaration.properties.usages.checkbox=Usages of &properties
|
||||||
|
find.declaration.constructor.usages.checkbox=Usages of &constructor
|
||||||
|
find.declaration.derived.classes.checkbox=&Derived classes
|
||||||
|
find.declaration.derived.interfaces.checkbox=Derived &interfaces
|
||||||
|
|
||||||
|
find.usages.class=class
|
||||||
|
find.usages.companion.object=companion object
|
||||||
|
find.usages.constructor=constructor
|
||||||
|
find.usages.facade.class=facade class
|
||||||
|
find.usages.for.property={0} for property
|
||||||
|
find.usages.function=function
|
||||||
|
find.usages.getter=getter
|
||||||
|
find.usages.import.alias=import alias
|
||||||
|
find.usages.interface=interface
|
||||||
|
find.usages.label=label
|
||||||
|
find.usages.lambda=lambda
|
||||||
|
find.usages.object=object
|
||||||
|
find.usages.parameter=parameter
|
||||||
|
find.usages.property.accessor=property accessor
|
||||||
|
find.usages.property=property
|
||||||
|
find.usages.setter=setter
|
||||||
|
find.usages.type.alias=type alias
|
||||||
|
find.usages.type.parameter=type parameter
|
||||||
|
find.usages.variable=variable
|
||||||
|
find.usages.checkbox.name.expected.classes=Expected classes
|
||||||
|
find.usages.class.name.anonymous=Anonymous
|
||||||
|
find.usages.checkbox.name.expected.functions=Expected functions
|
||||||
|
find.usages.text.find.usages.for.data.class.components.and.destruction.declarations=<p>Find usages for data class components and destructuring declarations<br/>could be <a href="{0}">disabled once</a> or <a href="{1}">disabled for a project</a>.</p>
|
||||||
|
find.usages.tool.tip.text.disable.search.for.data.class.components.and.destruction.declarations.project.wide.setting=Disable search for data class components and destructuring declarations. (Project wide setting)
|
||||||
|
find.usages.checkbox.text.fast.data.class.component.search=Fast data class component search
|
||||||
|
find.usages.checkbox.name.expected.properties=Expected properties
|
||||||
|
find.usages.action.text.find.usages.of=find usages of
|
||||||
|
|
||||||
|
find.usages.type.named.argument=Named argument
|
||||||
|
find.usages.type.type.alias=Type alias
|
||||||
|
find.usages.type.callable.reference=Callable reference
|
||||||
|
find.usages.type.type.constraint=Type constraint
|
||||||
|
find.usages.type.value.parameter.type=Parameter type
|
||||||
|
find.usages.type.nonLocal.property.type=Class/object property type
|
||||||
|
find.usages.type.function.return.type=Function return types
|
||||||
|
find.usages.type.superType=Supertype
|
||||||
|
find.usages.type.is=Target type of 'is' operation
|
||||||
|
find.usages.type.class.object=Nested class/object
|
||||||
|
find.usages.type.companion.object=Companion object
|
||||||
|
find.usages.type.function.call=Function call
|
||||||
|
find.usages.type.implicit.get=Implicit 'get'
|
||||||
|
find.usages.type.implicit.set=Implicit 'set'
|
||||||
|
find.usages.type.implicit.invoke=Implicit 'invoke'
|
||||||
|
find.usages.type.implicit.iteration=Implicit iteration
|
||||||
|
find.usages.type.property.delegation=Property delegation
|
||||||
|
find.usages.type.extension.receiver.type=Extension receiver type
|
||||||
|
find.usages.type.super.type.qualifier=Super type qualifier
|
||||||
|
find.usages.type.receiver=Receiver
|
||||||
|
find.usages.type.delegate=Delegate
|
||||||
|
find.usages.type.packageDirective=Package directive
|
||||||
|
find.usages.type.packageMemberAccess=Package member access
|
||||||
|
|
||||||
|
and.delete.initializer=\ and delete initializer
|
||||||
|
change.to.val=Change to val
|
||||||
|
change.to.var=Change to var
|
||||||
|
|
||||||
|
remove.redundant.0.modifier=Remove redundant ''{0}'' modifier
|
||||||
|
searching.for.implicit.usages=Searching for implicit usages...
|
||||||
-73
@@ -1,73 +0,0 @@
|
|||||||
find.declaration.implementing.methods.checkbox=&Implementing functions
|
|
||||||
find.declaration.overriding.methods.checkbox=Over&riding functions
|
|
||||||
find.declaration.implementing.properties.checkbox=&Implementing properties
|
|
||||||
find.declaration.overriding.properties.checkbox=Over&riding properties
|
|
||||||
find.declaration.property.readers.checkbox=Readers
|
|
||||||
find.declaration.property.writers.checkbox=Writers
|
|
||||||
find.declaration.include.overloaded.methods.checkbox=Include o&verloaded functions and extensions
|
|
||||||
find.declaration.functions.usages.checkbox=Usages of &functions
|
|
||||||
find.declaration.properties.usages.checkbox=Usages of &properties
|
|
||||||
find.declaration.constructor.usages.checkbox=Usages of &constructor
|
|
||||||
find.declaration.derived.classes.checkbox=&Derived classes
|
|
||||||
find.declaration.derived.interfaces.checkbox=Derived &interfaces
|
|
||||||
|
|
||||||
find.usages.class=class
|
|
||||||
find.usages.companion.object=companion object
|
|
||||||
find.usages.constructor=constructor
|
|
||||||
find.usages.facade.class=facade class
|
|
||||||
find.usages.for.property={0} for property
|
|
||||||
find.usages.function=function
|
|
||||||
find.usages.getter=getter
|
|
||||||
find.usages.import.alias=import alias
|
|
||||||
find.usages.interface=interface
|
|
||||||
find.usages.label=label
|
|
||||||
find.usages.lambda=lambda
|
|
||||||
find.usages.object=object
|
|
||||||
find.usages.parameter=parameter
|
|
||||||
find.usages.property.accessor=property accessor
|
|
||||||
find.usages.property=property
|
|
||||||
find.usages.setter=setter
|
|
||||||
find.usages.type.alias=type alias
|
|
||||||
find.usages.type.parameter=type parameter
|
|
||||||
find.usages.variable=variable
|
|
||||||
find.usages.checkbox.name.expected.classes=Expected classes
|
|
||||||
find.usages.class.name.anonymous=Anonymous
|
|
||||||
find.usages.checkbox.name.expected.functions=Expected functions
|
|
||||||
find.usages.text.find.usages.for.data.class.components.and.destruction.declarations=<p>Find usages for data class components and destructuring declarations<br/>could be <a href="{0}">disabled once</a> or <a href="{1}">disabled for a project</a>.</p>
|
|
||||||
find.usages.tool.tip.text.disable.search.for.data.class.components.and.destruction.declarations.project.wide.setting=Disable search for data class components and destructuring declarations. (Project wide setting)
|
|
||||||
find.usages.checkbox.text.fast.data.class.component.search=Fast data class component search
|
|
||||||
find.usages.checkbox.name.expected.properties=Expected properties
|
|
||||||
find.usages.action.text.find.usages.of=find usages of
|
|
||||||
|
|
||||||
find.usages.type.named.argument=Named argument
|
|
||||||
find.usages.type.type.alias=Type alias
|
|
||||||
find.usages.type.callable.reference=Callable reference
|
|
||||||
find.usages.type.type.constraint=Type constraint
|
|
||||||
find.usages.type.value.parameter.type=Parameter type
|
|
||||||
find.usages.type.nonLocal.property.type=Class/object property type
|
|
||||||
find.usages.type.function.return.type=Function return types
|
|
||||||
find.usages.type.superType=Supertype
|
|
||||||
find.usages.type.is=Target type of 'is' operation
|
|
||||||
find.usages.type.class.object=Nested class/object
|
|
||||||
find.usages.type.companion.object=Companion object
|
|
||||||
find.usages.type.function.call=Function call
|
|
||||||
find.usages.type.implicit.get=Implicit 'get'
|
|
||||||
find.usages.type.implicit.set=Implicit 'set'
|
|
||||||
find.usages.type.implicit.invoke=Implicit 'invoke'
|
|
||||||
find.usages.type.implicit.iteration=Implicit iteration
|
|
||||||
find.usages.type.property.delegation=Property delegation
|
|
||||||
find.usages.type.extension.receiver.type=Extension receiver type
|
|
||||||
find.usages.type.super.type.qualifier=Super type qualifier
|
|
||||||
find.usages.type.receiver=Receiver
|
|
||||||
find.usages.type.delegate=Delegate
|
|
||||||
find.usages.type.packageDirective=Package directive
|
|
||||||
find.usages.type.packageMemberAccess=Package member access
|
|
||||||
|
|
||||||
and.delete.initializer=\ and delete initializer
|
|
||||||
change.to.val=Change to val
|
|
||||||
change.to.var=Change to var
|
|
||||||
|
|
||||||
remove.redundant.0.modifier=Remove redundant ''{0}'' modifier
|
|
||||||
make.0.not.1=Make {0} not {1}
|
|
||||||
remove.0.modifier=Remove ''{0}'' modifier
|
|
||||||
remove.modifier=Remove modifier
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
searching.for.implicit.usages=Searching for implicit usages...
|
|
||||||
-12
@@ -1,12 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea
|
|
||||||
|
|
||||||
import com.intellij.DynamicBundle
|
|
||||||
|
|
||||||
abstract class AbstractKotlinBundleIndependent protected constructor(pathToBundle: String) : DynamicBundle(pathToBundle) {
|
|
||||||
protected fun String.withHtml(): String = "<html>$this</html>"
|
|
||||||
}
|
|
||||||
-24
@@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
package org.jetbrains.kotlin.idea
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NonNls
|
|
||||||
import org.jetbrains.annotations.PropertyKey
|
|
||||||
|
|
||||||
@NonNls
|
|
||||||
private const val BUNDLE = "messages.KotlinBundleIndependent"
|
|
||||||
|
|
||||||
//TODO Copy-pasted from KotlinBundle.kt
|
|
||||||
object KotlinBundleIndependent : AbstractKotlinBundleIndependent(BUNDLE) {
|
|
||||||
@JvmStatic
|
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
|
||||||
|
|
||||||
@JvmStatic
|
|
||||||
fun htmlMessage(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String =
|
|
||||||
getMessage(key, *params).withHtml()
|
|
||||||
|
|
||||||
@JvmStatic
|
|
||||||
fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): () -> String = { getMessage(key, *params) }
|
|
||||||
}
|
|
||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
package org.jetbrains.kotlin.idea
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NonNls
|
|
||||||
import org.jetbrains.annotations.PropertyKey
|
|
||||||
|
|
||||||
@NonNls
|
|
||||||
private const val BUNDLE = "messages.KotlinIdeaAnalysisBundleIndependent"
|
|
||||||
|
|
||||||
object KotlinIdeaAnalysisBundleIndependent : AbstractKotlinBundleIndependent(BUNDLE) {
|
|
||||||
@JvmStatic
|
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
|
||||||
|
|
||||||
@JvmStatic
|
|
||||||
fun htmlMessage(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String =
|
|
||||||
getMessage(key, *params).withHtml()
|
|
||||||
|
|
||||||
@JvmStatic
|
|
||||||
fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): () -> String = { getMessage(key, *params) }
|
|
||||||
}
|
|
||||||
+22
-22
@@ -29,7 +29,7 @@ import com.intellij.usageView.UsageViewShortNameLocation
|
|||||||
import com.intellij.usageView.UsageViewTypeLocation
|
import com.intellij.usageView.UsageViewTypeLocation
|
||||||
import org.jetbrains.kotlin.asJava.classes.KtLightClassForFacade
|
import org.jetbrains.kotlin.asJava.classes.KtLightClassForFacade
|
||||||
import org.jetbrains.kotlin.asJava.unwrapped
|
import org.jetbrains.kotlin.asJava.unwrapped
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.KotlinLanguage
|
import org.jetbrains.kotlin.idea.KotlinLanguage
|
||||||
import org.jetbrains.kotlin.name.FqNameUnsafe
|
import org.jetbrains.kotlin.name.FqNameUnsafe
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
@@ -138,39 +138,39 @@ open class KotlinElementDescriptionProviderBase : ElementDescriptionProvider {
|
|||||||
|
|
||||||
fun elementKind() = when (targetElement) {
|
fun elementKind() = when (targetElement) {
|
||||||
is KtClass -> if (targetElement.isInterface())
|
is KtClass -> if (targetElement.isInterface())
|
||||||
KotlinBundleIndependent.message("find.usages.interface")
|
KotlinBundle.message("find.usages.interface")
|
||||||
else
|
else
|
||||||
KotlinBundleIndependent.message("find.usages.class")
|
KotlinBundle.message("find.usages.class")
|
||||||
is KtObjectDeclaration -> if (targetElement.isCompanion())
|
is KtObjectDeclaration -> if (targetElement.isCompanion())
|
||||||
KotlinBundleIndependent.message("find.usages.companion.object")
|
KotlinBundle.message("find.usages.companion.object")
|
||||||
else
|
else
|
||||||
KotlinBundleIndependent.message("find.usages.object")
|
KotlinBundle.message("find.usages.object")
|
||||||
is KtNamedFunction -> KotlinBundleIndependent.message("find.usages.function")
|
is KtNamedFunction -> KotlinBundle.message("find.usages.function")
|
||||||
is KtPropertyAccessor -> KotlinBundleIndependent.message(
|
is KtPropertyAccessor -> KotlinBundle.message(
|
||||||
"find.usages.for.property",
|
"find.usages.for.property",
|
||||||
(if (targetElement.isGetter)
|
(if (targetElement.isGetter)
|
||||||
KotlinBundleIndependent.message("find.usages.getter")
|
KotlinBundle.message("find.usages.getter")
|
||||||
else
|
else
|
||||||
KotlinBundleIndependent.message("find.usages.setter"))
|
KotlinBundle.message("find.usages.setter"))
|
||||||
) + " "
|
) + " "
|
||||||
is KtFunctionLiteral -> KotlinBundleIndependent.message("find.usages.lambda")
|
is KtFunctionLiteral -> KotlinBundle.message("find.usages.lambda")
|
||||||
is KtPrimaryConstructor, is KtSecondaryConstructor -> KotlinBundleIndependent.message("find.usages.constructor")
|
is KtPrimaryConstructor, is KtSecondaryConstructor -> KotlinBundle.message("find.usages.constructor")
|
||||||
is KtProperty -> if (targetElement.isLocal)
|
is KtProperty -> if (targetElement.isLocal)
|
||||||
KotlinBundleIndependent.message("find.usages.variable")
|
KotlinBundle.message("find.usages.variable")
|
||||||
else
|
else
|
||||||
KotlinBundleIndependent.message("find.usages.property")
|
KotlinBundle.message("find.usages.property")
|
||||||
is KtTypeParameter -> KotlinBundleIndependent.message("find.usages.type.parameter")
|
is KtTypeParameter -> KotlinBundle.message("find.usages.type.parameter")
|
||||||
is KtParameter -> KotlinBundleIndependent.message("find.usages.parameter")
|
is KtParameter -> KotlinBundle.message("find.usages.parameter")
|
||||||
is KtDestructuringDeclarationEntry -> KotlinBundleIndependent.message("find.usages.variable")
|
is KtDestructuringDeclarationEntry -> KotlinBundle.message("find.usages.variable")
|
||||||
is KtTypeAlias -> KotlinBundleIndependent.message("find.usages.type.alias")
|
is KtTypeAlias -> KotlinBundle.message("find.usages.type.alias")
|
||||||
is KtLabeledExpression -> KotlinBundleIndependent.message("find.usages.label")
|
is KtLabeledExpression -> KotlinBundle.message("find.usages.label")
|
||||||
is KtImportAlias -> KotlinBundleIndependent.message("find.usages.import.alias")
|
is KtImportAlias -> KotlinBundle.message("find.usages.import.alias")
|
||||||
is KtLightClassForFacade -> KotlinBundleIndependent.message("find.usages.facade.class")
|
is KtLightClassForFacade -> KotlinBundle.message("find.usages.facade.class")
|
||||||
else -> {
|
else -> {
|
||||||
//TODO Implement in FIR
|
//TODO Implement in FIR
|
||||||
when {
|
when {
|
||||||
targetElement.isRenameJavaSyntheticPropertyHandler -> KotlinBundleIndependent.message("find.usages.property")
|
targetElement.isRenameJavaSyntheticPropertyHandler -> KotlinBundle.message("find.usages.property")
|
||||||
targetElement.isRenameKotlinPropertyProcessor -> KotlinBundleIndependent.message("find.usages.property.accessor")
|
targetElement.isRenameKotlinPropertyProcessor -> KotlinBundle.message("find.usages.property.accessor")
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -29,7 +29,7 @@ import com.intellij.psi.PsiElement
|
|||||||
import com.intellij.psi.search.searches.OverridingMethodsSearch
|
import com.intellij.psi.search.searches.OverridingMethodsSearch
|
||||||
import org.jetbrains.kotlin.asJava.toLightMethods
|
import org.jetbrains.kotlin.asJava.toLightMethods
|
||||||
import org.jetbrains.kotlin.asJava.unwrapped
|
import org.jetbrains.kotlin.asJava.unwrapped
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.findUsages.KotlinFindUsagesSupport.Companion.checkSuperMethods
|
import org.jetbrains.kotlin.idea.findUsages.KotlinFindUsagesSupport.Companion.checkSuperMethods
|
||||||
import org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport.Companion.isOverridable
|
import org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport.Companion.isOverridable
|
||||||
import org.jetbrains.kotlin.idea.findUsages.handlers.DelegatingFindMemberUsagesHandler
|
import org.jetbrains.kotlin.idea.findUsages.handlers.DelegatingFindMemberUsagesHandler
|
||||||
@@ -85,7 +85,7 @@ class KotlinFindUsagesHandlerFactory(project: Project) : FindUsagesHandlerFactor
|
|||||||
val declarationsToSearch = checkSuperMethods(
|
val declarationsToSearch = checkSuperMethods(
|
||||||
element,
|
element,
|
||||||
null,
|
null,
|
||||||
KotlinBundleIndependent.message("find.usages.action.text.find.usages.of")
|
KotlinBundle.message("find.usages.action.text.find.usages.of")
|
||||||
)
|
)
|
||||||
|
|
||||||
return handlerForMultiple(element, declarationsToSearch)
|
return handlerForMultiple(element, declarationsToSearch)
|
||||||
@@ -122,7 +122,7 @@ class KotlinFindUsagesHandlerFactory(project: Project) : FindUsagesHandlerFactor
|
|||||||
val declarationsToSearch = checkSuperMethods(
|
val declarationsToSearch = checkSuperMethods(
|
||||||
declaration,
|
declaration,
|
||||||
null,
|
null,
|
||||||
KotlinBundleIndependent.message("find.usages.action.text.find.usages.of")
|
KotlinBundle.message("find.usages.action.text.find.usages.of")
|
||||||
)
|
)
|
||||||
|
|
||||||
return handlerForMultiple(declaration, declarationsToSearch)
|
return handlerForMultiple(declaration, declarationsToSearch)
|
||||||
|
|||||||
+10
-10
@@ -10,7 +10,7 @@ import com.intellij.lang.findUsages.FindUsagesProvider
|
|||||||
import com.intellij.lang.java.JavaFindUsagesProvider
|
import com.intellij.lang.java.JavaFindUsagesProvider
|
||||||
import com.intellij.psi.*
|
import com.intellij.psi.*
|
||||||
import org.jetbrains.kotlin.asJava.elements.KtLightElement
|
import org.jetbrains.kotlin.asJava.elements.KtLightElement
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
|
import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.isPropertyParameter
|
import org.jetbrains.kotlin.psi.psiUtil.isPropertyParameter
|
||||||
@@ -27,17 +27,17 @@ open class KotlinFindUsagesProviderBase : FindUsagesProvider {
|
|||||||
|
|
||||||
override fun getType(element: PsiElement): String {
|
override fun getType(element: PsiElement): String {
|
||||||
return when (element) {
|
return when (element) {
|
||||||
is KtNamedFunction -> KotlinBundleIndependent.message("find.usages.function")
|
is KtNamedFunction -> KotlinBundle.message("find.usages.function")
|
||||||
is KtClass -> KotlinBundleIndependent.message("find.usages.class")
|
is KtClass -> KotlinBundle.message("find.usages.class")
|
||||||
is KtParameter -> KotlinBundleIndependent.message("find.usages.parameter")
|
is KtParameter -> KotlinBundle.message("find.usages.parameter")
|
||||||
is KtProperty -> if (element.isLocal)
|
is KtProperty -> if (element.isLocal)
|
||||||
KotlinBundleIndependent.message("find.usages.variable")
|
KotlinBundle.message("find.usages.variable")
|
||||||
else
|
else
|
||||||
KotlinBundleIndependent.message("find.usages.property")
|
KotlinBundle.message("find.usages.property")
|
||||||
is KtDestructuringDeclarationEntry -> KotlinBundleIndependent.message("find.usages.variable")
|
is KtDestructuringDeclarationEntry -> KotlinBundle.message("find.usages.variable")
|
||||||
is KtTypeParameter -> KotlinBundleIndependent.message("find.usages.type.parameter")
|
is KtTypeParameter -> KotlinBundle.message("find.usages.type.parameter")
|
||||||
is KtSecondaryConstructor -> KotlinBundleIndependent.message("find.usages.constructor")
|
is KtSecondaryConstructor -> KotlinBundle.message("find.usages.constructor")
|
||||||
is KtObjectDeclaration -> KotlinBundleIndependent.message("find.usages.object")
|
is KtObjectDeclaration -> KotlinBundle.message("find.usages.object")
|
||||||
else -> ""
|
else -> ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-24
@@ -6,7 +6,7 @@
|
|||||||
package org.jetbrains.kotlin.idea.findUsages
|
package org.jetbrains.kotlin.idea.findUsages
|
||||||
|
|
||||||
import com.intellij.usages.impl.rules.UsageType
|
import com.intellij.usages.impl.rules.UsageType
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
|
|
||||||
object KotlinUsageTypes {
|
object KotlinUsageTypes {
|
||||||
|
|
||||||
@@ -52,35 +52,35 @@ object KotlinUsageTypes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// types
|
// types
|
||||||
val TYPE_CONSTRAINT = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.type.constraint"))
|
val TYPE_CONSTRAINT = UsageType(KotlinBundle.lazyMessage("find.usages.type.type.constraint"))
|
||||||
val VALUE_PARAMETER_TYPE = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.value.parameter.type"))
|
val VALUE_PARAMETER_TYPE = UsageType(KotlinBundle.lazyMessage("find.usages.type.value.parameter.type"))
|
||||||
val NON_LOCAL_PROPERTY_TYPE = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.nonLocal.property.type"))
|
val NON_LOCAL_PROPERTY_TYPE = UsageType(KotlinBundle.lazyMessage("find.usages.type.nonLocal.property.type"))
|
||||||
val FUNCTION_RETURN_TYPE = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.function.return.type"))
|
val FUNCTION_RETURN_TYPE = UsageType(KotlinBundle.lazyMessage("find.usages.type.function.return.type"))
|
||||||
val SUPER_TYPE = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.superType"))
|
val SUPER_TYPE = UsageType(KotlinBundle.lazyMessage("find.usages.type.superType"))
|
||||||
val IS = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.is"))
|
val IS = UsageType(KotlinBundle.lazyMessage("find.usages.type.is"))
|
||||||
val CLASS_OBJECT_ACCESS = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.class.object"))
|
val CLASS_OBJECT_ACCESS = UsageType(KotlinBundle.lazyMessage("find.usages.type.class.object"))
|
||||||
val COMPANION_OBJECT_ACCESS = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.companion.object"))
|
val COMPANION_OBJECT_ACCESS = UsageType(KotlinBundle.lazyMessage("find.usages.type.companion.object"))
|
||||||
val EXTENSION_RECEIVER_TYPE = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.extension.receiver.type"))
|
val EXTENSION_RECEIVER_TYPE = UsageType(KotlinBundle.lazyMessage("find.usages.type.extension.receiver.type"))
|
||||||
val SUPER_TYPE_QUALIFIER = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.super.type.qualifier"))
|
val SUPER_TYPE_QUALIFIER = UsageType(KotlinBundle.lazyMessage("find.usages.type.super.type.qualifier"))
|
||||||
val TYPE_ALIAS = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.type.alias"))
|
val TYPE_ALIAS = UsageType(KotlinBundle.lazyMessage("find.usages.type.type.alias"))
|
||||||
|
|
||||||
// functions
|
// functions
|
||||||
val FUNCTION_CALL = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.function.call"))
|
val FUNCTION_CALL = UsageType(KotlinBundle.lazyMessage("find.usages.type.function.call"))
|
||||||
val IMPLICIT_GET = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.implicit.get"))
|
val IMPLICIT_GET = UsageType(KotlinBundle.lazyMessage("find.usages.type.implicit.get"))
|
||||||
val IMPLICIT_SET = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.implicit.set"))
|
val IMPLICIT_SET = UsageType(KotlinBundle.lazyMessage("find.usages.type.implicit.set"))
|
||||||
val IMPLICIT_INVOKE = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.implicit.invoke"))
|
val IMPLICIT_INVOKE = UsageType(KotlinBundle.lazyMessage("find.usages.type.implicit.invoke"))
|
||||||
val IMPLICIT_ITERATION = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.implicit.iteration"))
|
val IMPLICIT_ITERATION = UsageType(KotlinBundle.lazyMessage("find.usages.type.implicit.iteration"))
|
||||||
val PROPERTY_DELEGATION = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.property.delegation"))
|
val PROPERTY_DELEGATION = UsageType(KotlinBundle.lazyMessage("find.usages.type.property.delegation"))
|
||||||
|
|
||||||
// values
|
// values
|
||||||
val RECEIVER = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.receiver"))
|
val RECEIVER = UsageType(KotlinBundle.lazyMessage("find.usages.type.receiver"))
|
||||||
val DELEGATE = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.delegate"))
|
val DELEGATE = UsageType(KotlinBundle.lazyMessage("find.usages.type.delegate"))
|
||||||
|
|
||||||
// packages
|
// packages
|
||||||
val PACKAGE_DIRECTIVE = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.packageDirective"))
|
val PACKAGE_DIRECTIVE = UsageType(KotlinBundle.lazyMessage("find.usages.type.packageDirective"))
|
||||||
val PACKAGE_MEMBER_ACCESS = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.packageMemberAccess"))
|
val PACKAGE_MEMBER_ACCESS = UsageType(KotlinBundle.lazyMessage("find.usages.type.packageMemberAccess"))
|
||||||
|
|
||||||
// common usage types
|
// common usage types
|
||||||
val CALLABLE_REFERENCE = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.callable.reference"))
|
val CALLABLE_REFERENCE = UsageType(KotlinBundle.lazyMessage("find.usages.type.callable.reference"))
|
||||||
val NAMED_ARGUMENT = UsageType(KotlinBundleIndependent.lazyMessage("find.usages.type.named.argument"))
|
val NAMED_ARGUMENT = UsageType(KotlinBundle.lazyMessage("find.usages.type.named.argument"))
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-8
@@ -32,7 +32,7 @@ import com.intellij.ui.StateRestoringCheckBox;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.kotlin.asJava.LightClassUtilsKt;
|
import org.jetbrains.kotlin.asJava.LightClassUtilsKt;
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent;
|
import org.jetbrains.kotlin.idea.KotlinBundle;
|
||||||
import org.jetbrains.kotlin.idea.findUsages.KotlinClassFindUsagesOptions;
|
import org.jetbrains.kotlin.idea.findUsages.KotlinClassFindUsagesOptions;
|
||||||
import org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport;
|
import org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport;
|
||||||
import org.jetbrains.kotlin.psi.KtClass;
|
import org.jetbrains.kotlin.psi.KtClass;
|
||||||
@@ -73,7 +73,7 @@ public class KotlinFindClassUsagesDialog extends FindClassUsagesDialog {
|
|||||||
|
|
||||||
String name = classOrObject.getName();
|
String name = classOrObject.getName();
|
||||||
if (name == null || name.isEmpty()) {
|
if (name == null || name.isEmpty()) {
|
||||||
name = KotlinBundleIndependent.message("find.usages.class.name.anonymous");
|
name = KotlinBundle.message("find.usages.class.name.anonymous");
|
||||||
}
|
}
|
||||||
|
|
||||||
PsiClass javaClass;
|
PsiClass javaClass;
|
||||||
@@ -108,31 +108,31 @@ public class KotlinFindClassUsagesDialog extends FindClassUsagesDialog {
|
|||||||
Utils.renameCheckbox(
|
Utils.renameCheckbox(
|
||||||
findWhatPanel,
|
findWhatPanel,
|
||||||
FindBundle.message("find.what.methods.usages.checkbox"),
|
FindBundle.message("find.what.methods.usages.checkbox"),
|
||||||
KotlinBundleIndependent.message("find.declaration.functions.usages.checkbox")
|
KotlinBundle.message("find.declaration.functions.usages.checkbox")
|
||||||
);
|
);
|
||||||
Utils.renameCheckbox(
|
Utils.renameCheckbox(
|
||||||
findWhatPanel,
|
findWhatPanel,
|
||||||
FindBundle.message("find.what.fields.usages.checkbox"),
|
FindBundle.message("find.what.fields.usages.checkbox"),
|
||||||
KotlinBundleIndependent.message("find.declaration.properties.usages.checkbox")
|
KotlinBundle.message("find.declaration.properties.usages.checkbox")
|
||||||
);
|
);
|
||||||
Utils.removeCheckbox(findWhatPanel, FindBundle.message("find.what.implementing.classes.checkbox"));
|
Utils.removeCheckbox(findWhatPanel, FindBundle.message("find.what.implementing.classes.checkbox"));
|
||||||
Utils.removeCheckbox(findWhatPanel, FindBundle.message("find.what.derived.interfaces.checkbox"));
|
Utils.removeCheckbox(findWhatPanel, FindBundle.message("find.what.derived.interfaces.checkbox"));
|
||||||
Utils.removeCheckbox(findWhatPanel, FindBundle.message("find.what.derived.classes.checkbox"));
|
Utils.removeCheckbox(findWhatPanel, FindBundle.message("find.what.derived.classes.checkbox"));
|
||||||
|
|
||||||
derivedClasses = addCheckboxToPanel(
|
derivedClasses = addCheckboxToPanel(
|
||||||
KotlinBundleIndependent.message("find.declaration.derived.classes.checkbox"),
|
KotlinBundle.message("find.declaration.derived.classes.checkbox"),
|
||||||
getFindUsagesOptions().isDerivedClasses,
|
getFindUsagesOptions().isDerivedClasses,
|
||||||
findWhatPanel,
|
findWhatPanel,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
derivedTraits = addCheckboxToPanel(
|
derivedTraits = addCheckboxToPanel(
|
||||||
KotlinBundleIndependent.message("find.declaration.derived.interfaces.checkbox"),
|
KotlinBundle.message("find.declaration.derived.interfaces.checkbox"),
|
||||||
getFindUsagesOptions().isDerivedInterfaces,
|
getFindUsagesOptions().isDerivedInterfaces,
|
||||||
findWhatPanel,
|
findWhatPanel,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
constructorUsages = addCheckboxToPanel(
|
constructorUsages = addCheckboxToPanel(
|
||||||
KotlinBundleIndependent.message("find.declaration.constructor.usages.checkbox"),
|
KotlinBundle.message("find.declaration.constructor.usages.checkbox"),
|
||||||
getFindUsagesOptions().getSearchConstructorUsages(),
|
getFindUsagesOptions().getSearchConstructorUsages(),
|
||||||
findWhatPanel,
|
findWhatPanel,
|
||||||
true
|
true
|
||||||
@@ -164,7 +164,7 @@ public class KotlinFindClassUsagesDialog extends FindClassUsagesDialog {
|
|||||||
KotlinClassFindUsagesOptions options = getFindUsagesOptions();
|
KotlinClassFindUsagesOptions options = getFindUsagesOptions();
|
||||||
if (isActual) {
|
if (isActual) {
|
||||||
expectedUsages = addCheckboxToPanel(
|
expectedUsages = addCheckboxToPanel(
|
||||||
KotlinBundleIndependent.message("find.usages.checkbox.name.expected.classes"),
|
KotlinBundle.message("find.usages.checkbox.name.expected.classes"),
|
||||||
options.getSearchExpected(),
|
options.getSearchExpected(),
|
||||||
optionsPanel,
|
optionsPanel,
|
||||||
false
|
false
|
||||||
|
|||||||
+6
-6
@@ -29,7 +29,7 @@ import com.intellij.ui.StateRestoringCheckBox;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.asJava.LightClassUtilsKt;
|
import org.jetbrains.kotlin.asJava.LightClassUtilsKt;
|
||||||
import org.jetbrains.kotlin.asJava.elements.KtLightMethod;
|
import org.jetbrains.kotlin.asJava.elements.KtLightMethod;
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent;
|
import org.jetbrains.kotlin.idea.KotlinBundle;
|
||||||
import org.jetbrains.kotlin.idea.findUsages.KotlinFunctionFindUsagesOptions;
|
import org.jetbrains.kotlin.idea.findUsages.KotlinFunctionFindUsagesOptions;
|
||||||
import org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport;
|
import org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport;
|
||||||
import org.jetbrains.kotlin.psi.KtDeclaration;
|
import org.jetbrains.kotlin.psi.KtDeclaration;
|
||||||
@@ -72,12 +72,12 @@ public class KotlinFindFunctionUsagesDialog extends FindMethodUsagesDialog {
|
|||||||
Utils.renameCheckbox(
|
Utils.renameCheckbox(
|
||||||
findWhatPanel,
|
findWhatPanel,
|
||||||
FindBundle.message("find.what.implementing.methods.checkbox"),
|
FindBundle.message("find.what.implementing.methods.checkbox"),
|
||||||
KotlinBundleIndependent.message("find.declaration.implementing.methods.checkbox")
|
KotlinBundle.message("find.declaration.implementing.methods.checkbox")
|
||||||
);
|
);
|
||||||
Utils.renameCheckbox(
|
Utils.renameCheckbox(
|
||||||
findWhatPanel,
|
findWhatPanel,
|
||||||
FindBundle.message("find.what.overriding.methods.checkbox"),
|
FindBundle.message("find.what.overriding.methods.checkbox"),
|
||||||
KotlinBundleIndependent.message("find.declaration.overriding.methods.checkbox")
|
KotlinBundle.message("find.declaration.overriding.methods.checkbox")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,10 +91,10 @@ public class KotlinFindFunctionUsagesDialog extends FindMethodUsagesDialog {
|
|||||||
if (!Utils.renameCheckbox(
|
if (!Utils.renameCheckbox(
|
||||||
optionsPanel,
|
optionsPanel,
|
||||||
FindBundle.message("find.options.include.overloaded.methods.checkbox"),
|
FindBundle.message("find.options.include.overloaded.methods.checkbox"),
|
||||||
KotlinBundleIndependent.message("find.declaration.include.overloaded.methods.checkbox")
|
KotlinBundle.message("find.declaration.include.overloaded.methods.checkbox")
|
||||||
)) {
|
)) {
|
||||||
addCheckboxToPanel(
|
addCheckboxToPanel(
|
||||||
KotlinBundleIndependent.message("find.declaration.include.overloaded.methods.checkbox"),
|
KotlinBundle.message("find.declaration.include.overloaded.methods.checkbox"),
|
||||||
FindSettings.getInstance().isSearchOverloadedMethods(),
|
FindSettings.getInstance().isSearchOverloadedMethods(),
|
||||||
optionsPanel,
|
optionsPanel,
|
||||||
false
|
false
|
||||||
@@ -110,7 +110,7 @@ public class KotlinFindFunctionUsagesDialog extends FindMethodUsagesDialog {
|
|||||||
KotlinFunctionFindUsagesOptions options = getFindUsagesOptions();
|
KotlinFunctionFindUsagesOptions options = getFindUsagesOptions();
|
||||||
if (isActual) {
|
if (isActual) {
|
||||||
expectedUsages = addCheckboxToPanel(
|
expectedUsages = addCheckboxToPanel(
|
||||||
KotlinBundleIndependent.message("find.usages.checkbox.name.expected.functions"),
|
KotlinBundle.message("find.usages.checkbox.name.expected.functions"),
|
||||||
options.getSearchExpected(),
|
options.getSearchExpected(),
|
||||||
optionsPanel,
|
optionsPanel,
|
||||||
false
|
false
|
||||||
|
|||||||
+8
-8
@@ -27,7 +27,7 @@ import com.intellij.ui.IdeBorderFactory;
|
|||||||
import com.intellij.ui.SimpleColoredComponent;
|
import com.intellij.ui.SimpleColoredComponent;
|
||||||
import com.intellij.ui.StateRestoringCheckBox;
|
import com.intellij.ui.StateRestoringCheckBox;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent;
|
import org.jetbrains.kotlin.idea.KotlinBundle;
|
||||||
import org.jetbrains.kotlin.idea.findUsages.KotlinPropertyFindUsagesOptions;
|
import org.jetbrains.kotlin.idea.findUsages.KotlinPropertyFindUsagesOptions;
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens;
|
import org.jetbrains.kotlin.lexer.KtTokens;
|
||||||
import org.jetbrains.kotlin.psi.*;
|
import org.jetbrains.kotlin.psi.*;
|
||||||
@@ -85,13 +85,13 @@ public class KotlinFindPropertyUsagesDialog extends JavaFindUsagesDialog<KotlinP
|
|||||||
KotlinPropertyFindUsagesOptions options = getFindUsagesOptions();
|
KotlinPropertyFindUsagesOptions options = getFindUsagesOptions();
|
||||||
|
|
||||||
readAccesses = addCheckboxToPanel(
|
readAccesses = addCheckboxToPanel(
|
||||||
KotlinBundleIndependent.message("find.declaration.property.readers.checkbox"),
|
KotlinBundle.message("find.declaration.property.readers.checkbox"),
|
||||||
options.isReadAccess,
|
options.isReadAccess,
|
||||||
findWhatPanel,
|
findWhatPanel,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
writeAccesses = addCheckboxToPanel(
|
writeAccesses = addCheckboxToPanel(
|
||||||
KotlinBundleIndependent.message("find.declaration.property.writers.checkbox"),
|
KotlinBundle.message("find.declaration.property.writers.checkbox"),
|
||||||
options.isWriteAccess,
|
options.isWriteAccess,
|
||||||
findWhatPanel,
|
findWhatPanel,
|
||||||
true
|
true
|
||||||
@@ -116,8 +116,8 @@ public class KotlinFindPropertyUsagesDialog extends JavaFindUsagesDialog<KotlinP
|
|||||||
if (isOpen || isAbstract) {
|
if (isOpen || isAbstract) {
|
||||||
overrideUsages = addCheckboxToPanel(
|
overrideUsages = addCheckboxToPanel(
|
||||||
isAbstract
|
isAbstract
|
||||||
? KotlinBundleIndependent.message("find.declaration.implementing.properties.checkbox")
|
? KotlinBundle.message("find.declaration.implementing.properties.checkbox")
|
||||||
: KotlinBundleIndependent.message("find.declaration.overriding.properties.checkbox"),
|
: KotlinBundle.message("find.declaration.overriding.properties.checkbox"),
|
||||||
FindSettings.getInstance().isSearchOverloadedMethods(),
|
FindSettings.getInstance().isSearchOverloadedMethods(),
|
||||||
optionsPanel,
|
optionsPanel,
|
||||||
false
|
false
|
||||||
@@ -127,7 +127,7 @@ public class KotlinFindPropertyUsagesDialog extends JavaFindUsagesDialog<KotlinP
|
|||||||
KotlinPropertyFindUsagesOptions options = getFindUsagesOptions();
|
KotlinPropertyFindUsagesOptions options = getFindUsagesOptions();
|
||||||
if (isActual) {
|
if (isActual) {
|
||||||
expectedUsages = addCheckboxToPanel(
|
expectedUsages = addCheckboxToPanel(
|
||||||
KotlinBundleIndependent.message("find.usages.checkbox.name.expected.properties"),
|
KotlinBundle.message("find.usages.checkbox.name.expected.properties"),
|
||||||
options.getSearchExpected(),
|
options.getSearchExpected(),
|
||||||
optionsPanel,
|
optionsPanel,
|
||||||
false
|
false
|
||||||
@@ -136,8 +136,8 @@ public class KotlinFindPropertyUsagesDialog extends JavaFindUsagesDialog<KotlinP
|
|||||||
|
|
||||||
if (isDataClassConstructorProperty(property)) {
|
if (isDataClassConstructorProperty(property)) {
|
||||||
JCheckBox dataClassComponentCheckBox =
|
JCheckBox dataClassComponentCheckBox =
|
||||||
new JCheckBox(KotlinBundleIndependent.message("find.usages.checkbox.text.fast.data.class.component.search"));
|
new JCheckBox(KotlinBundle.message("find.usages.checkbox.text.fast.data.class.component.search"));
|
||||||
dataClassComponentCheckBox.setToolTipText(KotlinBundleIndependent.message(
|
dataClassComponentCheckBox.setToolTipText(KotlinBundle.message(
|
||||||
"find.usages.tool.tip.text.disable.search.for.data.class.components.and.destruction.declarations.project.wide.setting"));
|
"find.usages.tool.tip.text.disable.search.for.data.class.components.and.destruction.declarations.project.wide.setting"));
|
||||||
Project project = property.getProject();
|
Project project = property.getProject();
|
||||||
dataClassComponentCheckBox.setSelected(getDisableComponentAndDestructionSearch(project));
|
dataClassComponentCheckBox.setSelected(getDisableComponentAndDestructionSearch(project));
|
||||||
|
|||||||
+2
-2
@@ -31,7 +31,7 @@ import com.intellij.usageView.UsageInfo
|
|||||||
import com.intellij.util.*
|
import com.intellij.util.*
|
||||||
import org.jetbrains.annotations.TestOnly
|
import org.jetbrains.annotations.TestOnly
|
||||||
import org.jetbrains.kotlin.asJava.toLightMethods
|
import org.jetbrains.kotlin.asJava.toLightMethods
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.findUsages.*
|
import org.jetbrains.kotlin.idea.findUsages.*
|
||||||
import org.jetbrains.kotlin.idea.findUsages.KotlinFindUsagesSupport.Companion.getTopMostOverriddenElementsToHighlight
|
import org.jetbrains.kotlin.idea.findUsages.KotlinFindUsagesSupport.Companion.getTopMostOverriddenElementsToHighlight
|
||||||
import org.jetbrains.kotlin.idea.findUsages.KotlinFindUsagesSupport.Companion.isDataClassComponentFunction
|
import org.jetbrains.kotlin.idea.findUsages.KotlinFindUsagesSupport.Companion.isDataClassComponentFunction
|
||||||
@@ -299,7 +299,7 @@ abstract class KotlinFindMemberUsagesHandler<T : KtNamedDeclaration> protected c
|
|||||||
|
|
||||||
private const val DISABLE_ONCE = "DISABLE_ONCE"
|
private const val DISABLE_ONCE = "DISABLE_ONCE"
|
||||||
private const val DISABLE = "DISABLE"
|
private const val DISABLE = "DISABLE"
|
||||||
private val DISABLE_COMPONENT_AND_DESTRUCTION_SEARCH_TEXT = KotlinBundleIndependent.message(
|
private val DISABLE_COMPONENT_AND_DESTRUCTION_SEARCH_TEXT = KotlinBundle.message(
|
||||||
"find.usages.text.find.usages.for.data.class.components.and.destruction.declarations",
|
"find.usages.text.find.usages.for.data.class.components.and.destruction.declarations",
|
||||||
DISABLE_ONCE,
|
DISABLE_ONCE,
|
||||||
DISABLE
|
DISABLE
|
||||||
|
|||||||
+3
-3
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.idea.quickfix
|
|||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.psi.PsiElement
|
import com.intellij.psi.PsiElement
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
||||||
@@ -21,8 +21,8 @@ class ChangeVariableMutabilityFix(
|
|||||||
) : KotlinPsiOnlyQuickFixAction<KtValVarKeywordOwner>(element) {
|
) : KotlinPsiOnlyQuickFixAction<KtValVarKeywordOwner>(element) {
|
||||||
|
|
||||||
override fun getText() = actionText
|
override fun getText() = actionText
|
||||||
?: (if (makeVar) KotlinBundleIndependent.message("change.to.var") else KotlinBundleIndependent.message("change.to.val")) +
|
?: (if (makeVar) KotlinBundle.message("change.to.var") else KotlinBundle.message("change.to.val")) +
|
||||||
if (deleteInitializer) KotlinBundleIndependent.message("and.delete.initializer") else ""
|
if (deleteInitializer) KotlinBundle.message("and.delete.initializer") else ""
|
||||||
|
|
||||||
override fun getFamilyName(): String = text
|
override fun getFamilyName(): String = text
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -11,7 +11,7 @@ import com.intellij.psi.PsiElement
|
|||||||
import com.intellij.psi.PsiFile
|
import com.intellij.psi.PsiFile
|
||||||
import com.intellij.psi.PsiNameIdentifierOwner
|
import com.intellij.psi.PsiNameIdentifierOwner
|
||||||
import com.intellij.psi.util.PsiTreeUtil
|
import com.intellij.psi.util.PsiTreeUtil
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.lexer.KtModifierKeywordToken
|
import org.jetbrains.kotlin.lexer.KtModifierKeywordToken
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
@@ -28,15 +28,15 @@ class RemoveModifierFix(
|
|||||||
val modifierText = modifier.value
|
val modifierText = modifier.value
|
||||||
when {
|
when {
|
||||||
isRedundant ->
|
isRedundant ->
|
||||||
KotlinBundleIndependent.message("remove.redundant.0.modifier", modifierText)
|
KotlinBundle.message("remove.redundant.0.modifier", modifierText)
|
||||||
modifier === KtTokens.ABSTRACT_KEYWORD || modifier === KtTokens.OPEN_KEYWORD ->
|
modifier === KtTokens.ABSTRACT_KEYWORD || modifier === KtTokens.OPEN_KEYWORD ->
|
||||||
KotlinBundleIndependent.message("make.0.not.1", getElementName(element), modifierText)
|
KotlinBundle.message("make.0.not.1", getElementName(element), modifierText)
|
||||||
else ->
|
else ->
|
||||||
KotlinBundleIndependent.message("remove.0.modifier", modifierText, modifier)
|
KotlinBundle.message("remove.0.modifier", modifierText, modifier)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getFamilyName() = KotlinBundleIndependent.message("remove.modifier")
|
override fun getFamilyName() = KotlinBundle.message("remove.modifier")
|
||||||
|
|
||||||
override fun getText() = text
|
override fun getText() = text
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -12,8 +12,8 @@ import com.intellij.psi.search.*
|
|||||||
import com.intellij.util.Processor
|
import com.intellij.util.Processor
|
||||||
import org.jetbrains.kotlin.asJava.elements.KtLightMethod
|
import org.jetbrains.kotlin.asJava.elements.KtLightMethod
|
||||||
import org.jetbrains.kotlin.asJava.namedUnwrappedElement
|
import org.jetbrains.kotlin.asJava.namedUnwrappedElement
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.KotlinFileType
|
import org.jetbrains.kotlin.idea.KotlinFileType
|
||||||
import org.jetbrains.kotlin.idea.KotlinIdeaAnalysisBundleIndependent
|
|
||||||
import org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport.Companion.forceResolveReferences
|
import org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport.Companion.forceResolveReferences
|
||||||
import org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport.Companion.getReceiverTypeSearcherInfo
|
import org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport.Companion.getReceiverTypeSearcherInfo
|
||||||
import org.jetbrains.kotlin.idea.search.ideaExtensions.KotlinReferencesSearchOptions
|
import org.jetbrains.kotlin.idea.search.ideaExtensions.KotlinReferencesSearchOptions
|
||||||
@@ -275,7 +275,7 @@ abstract class OperatorReferenceSearcher<TReferenceElement : KtElement>(
|
|||||||
// we must unwrap progress indicator because ProgressWrapper does not do anything on changing text and fraction
|
// we must unwrap progress indicator because ProgressWrapper does not do anything on changing text and fraction
|
||||||
val progress = ProgressWrapper.unwrap(ProgressIndicatorProvider.getGlobalProgressIndicator())
|
val progress = ProgressWrapper.unwrap(ProgressIndicatorProvider.getGlobalProgressIndicator())
|
||||||
progress?.pushState()
|
progress?.pushState()
|
||||||
progress?.text = KotlinIdeaAnalysisBundleIndependent.message("searching.for.implicit.usages")
|
progress?.text = KotlinBundle.message("searching.for.implicit.usages")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val files = runReadAction { FileTypeIndex.getFiles(KotlinFileType.INSTANCE, scope) }
|
val files = runReadAction { FileTypeIndex.getFiles(KotlinFileType.INSTANCE, scope) }
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
|||||||
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
||||||
import org.jetbrains.kotlin.diagnostics.DiagnosticFactory1
|
import org.jetbrains.kotlin.diagnostics.DiagnosticFactory1
|
||||||
import org.jetbrains.kotlin.diagnostics.Errors
|
import org.jetbrains.kotlin.diagnostics.Errors
|
||||||
import org.jetbrains.kotlin.idea.KotlinBundleIndependent
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.createCallable.CreatePropertyDelegateAccessorsActionFactory
|
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.createCallable.CreatePropertyDelegateAccessorsActionFactory
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
import org.jetbrains.kotlin.psi.KtProperty
|
import org.jetbrains.kotlin.psi.KtProperty
|
||||||
@@ -55,6 +55,6 @@ object DelegatedPropertyValFactory : KotlinSingleIntentionActionFactory() {
|
|||||||
val property = element.getStrictParentOfType<KtProperty>() ?: return null
|
val property = element.getStrictParentOfType<KtProperty>() ?: return null
|
||||||
val info = CreatePropertyDelegateAccessorsActionFactory.extractFixData(property, diagnostic).singleOrNull() ?: return null
|
val info = CreatePropertyDelegateAccessorsActionFactory.extractFixData(property, diagnostic).singleOrNull() ?: return null
|
||||||
if (info.name != OperatorNameConventions.SET_VALUE.asString()) return null
|
if (info.name != OperatorNameConventions.SET_VALUE.asString()) return null
|
||||||
return ChangeVariableMutabilityFix(property, makeVar = false, actionText = KotlinBundleIndependent.message("change.to.val"))
|
return ChangeVariableMutabilityFix(property, makeVar = false, actionText = KotlinBundle.message("change.to.val"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user