Cleanup: remove empty primary constructor applied
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.*
|
||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.special.*
|
||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.*
|
||||
|
||||
open class InstructionVisitor() {
|
||||
open class InstructionVisitor {
|
||||
open fun visitAccessInstruction(instruction: AccessValueInstruction) {
|
||||
visitInstructionWithNext(instruction)
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.*
|
||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.*
|
||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.special.*
|
||||
|
||||
abstract class InstructionVisitorWithResult<out R>() {
|
||||
abstract class InstructionVisitorWithResult<out R> {
|
||||
abstract fun visitInstruction(instruction: Instruction): R
|
||||
|
||||
open fun visitAccessInstruction(instruction: AccessValueInstruction): R {
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.lexer.KtTokens
|
||||
/**
|
||||
* Parses the contents of a Markdown link in KDoc. Uses the standard Kotlin lexer.
|
||||
*/
|
||||
class KDocLinkParser(): PsiParser {
|
||||
class KDocLinkParser : PsiParser {
|
||||
companion object {
|
||||
@JvmStatic fun parseMarkdownLink(root: IElementType, chameleon: ASTNode): ASTNode {
|
||||
val parentElement = chameleon.treeParent.psi
|
||||
|
||||
@@ -50,7 +50,7 @@ class DecompileKotlinToJavaAction : AnAction() {
|
||||
fun KtFile.canBeDecompiledToJava() = isCompiled && virtualFile?.fileType == JavaClassFileType.INSTANCE
|
||||
|
||||
// Add action to "Attach sources" notification panel
|
||||
class DecompileKotlinToJavaActionProvider() : AttachSourcesProvider {
|
||||
class DecompileKotlinToJavaActionProvider : AttachSourcesProvider {
|
||||
override fun getActions(orderEntries: MutableList<LibraryOrderEntry>, psiFile: PsiFile): Collection<AttachSourcesProvider.AttachSourcesAction> {
|
||||
if (psiFile !is KtFile || !psiFile.canBeDecompiledToJava()) return emptyList()
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.idea.KotlinFileType
|
||||
import org.jetbrains.kotlin.idea.KotlinIcons
|
||||
import org.jetbrains.kotlin.idea.internal.KotlinBytecodeToolWindow
|
||||
|
||||
class ShowKotlinBytecodeAction(): AnAction() {
|
||||
class ShowKotlinBytecodeAction : AnAction() {
|
||||
val TOOLWINDOW_ID = "Kotlin Bytecode"
|
||||
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
||||
|
||||
abstract class KotlinGenerateActionBase() : CodeInsightAction(), CodeInsightActionHandler {
|
||||
abstract class KotlinGenerateActionBase : CodeInsightAction(), CodeInsightActionHandler {
|
||||
override fun update(
|
||||
presentation: Presentation,
|
||||
project: Project,
|
||||
|
||||
@@ -66,7 +66,7 @@ import java.io.IOException
|
||||
import java.util.*
|
||||
|
||||
//NOTE: this class is based on CopyPasteReferenceProcessor and JavaCopyPasteReferenceProcessor
|
||||
class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<KotlinReferenceTransferableData>() {
|
||||
class KotlinCopyPasteReferenceProcessor : CopyPastePostProcessor<KotlinReferenceTransferableData>() {
|
||||
private val LOG = Logger.getInstance(KotlinCopyPasteReferenceProcessor::class.java)
|
||||
|
||||
private val IGNORE_REFERENCES_INSIDE: Array<Class<out KtElement>> = arrayOf(
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import com.intellij.util.xmlb.XmlSerializerUtil
|
||||
storages = arrayOf(
|
||||
Storage(file = StoragePathMacros.WORKSPACE_FILE)
|
||||
)
|
||||
) class KotlinCompilerWorkspaceSettings() : PersistentStateComponent<KotlinCompilerWorkspaceSettings> {
|
||||
) class KotlinCompilerWorkspaceSettings : PersistentStateComponent<KotlinCompilerWorkspaceSettings> {
|
||||
var preciseIncrementalEnabled: Boolean = true
|
||||
var enableDaemon: Boolean = true
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import org.jetbrains.plugins.gradle.frameworkSupport.BuildScriptDataBuilder
|
||||
import org.jetbrains.plugins.gradle.frameworkSupport.GradleFrameworkSupportProvider
|
||||
import javax.swing.Icon
|
||||
|
||||
class GradleKotlinJavaFrameworkSupportProvider() : GradleFrameworkSupportProvider() {
|
||||
class GradleKotlinJavaFrameworkSupportProvider : GradleFrameworkSupportProvider() {
|
||||
override fun getFrameworkType(): FrameworkTypeEx = object : FrameworkTypeEx("KOTLIN") {
|
||||
override fun getIcon(): Icon = KotlinIcons.SMALL_LOGO
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import java.io.File
|
||||
|
||||
class KotlinCoverageExtension(): JavaCoverageEngineExtension() {
|
||||
class KotlinCoverageExtension : JavaCoverageEngineExtension() {
|
||||
private val LOG = Logger.getInstance(KotlinCoverageExtension::class.java)
|
||||
|
||||
override fun isApplicableTo(conf: RunConfigurationBase?): Boolean = conf is JetRunConfiguration
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.idea.editor.KotlinSmartEnterHandler
|
||||
|
||||
abstract class MissingConditionFixer<T: PsiElement>() : SmartEnterProcessorWithFixers.Fixer<KotlinSmartEnterHandler>() {
|
||||
abstract class MissingConditionFixer<T: PsiElement> : SmartEnterProcessorWithFixers.Fixer<KotlinSmartEnterHandler>() {
|
||||
override fun apply(editor: Editor, processor: KotlinSmartEnterHandler, element: PsiElement) {
|
||||
val workElement = getElement(element) ?: return
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ import org.jetbrains.kotlin.types.expressions.OperatorConventions
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||
import java.util.*
|
||||
|
||||
class KotlinRecursiveCallLineMarkerProvider() : LineMarkerProvider {
|
||||
class KotlinRecursiveCallLineMarkerProvider : LineMarkerProvider {
|
||||
override fun getLineMarkerInfo(element: PsiElement) = null
|
||||
|
||||
override fun collectSlowLineMarkers(elements: MutableList<PsiElement>, result: MutableCollection<LineMarkerInfo<*>>) {
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.jetbrains.kotlin.resolve.scopes.HierarchicalScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.*
|
||||
import java.util.*
|
||||
|
||||
class KotlinImportOptimizer() : ImportOptimizer {
|
||||
class KotlinImportOptimizer : ImportOptimizer {
|
||||
override fun supports(file: PsiFile?) = file is KtFile
|
||||
|
||||
override fun processFile(file: PsiFile?) = Runnable {
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.jetbrains.kotlin.psi.psiUtil.forEachDescendantOfType
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
|
||||
|
||||
class KotlinCleanupInspection(): LocalInspectionTool(), CleanupLocalInspectionTool {
|
||||
class KotlinCleanupInspection : LocalInspectionTool(), CleanupLocalInspectionTool {
|
||||
// required to simplify the inspection registration in tests
|
||||
override fun getDisplayName(): String = "Usage of redundant or deprecated syntax or deprecated symbols"
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.jetbrains.kotlin.types.isDynamic
|
||||
import org.jetbrains.kotlin.types.typeUtil.isTypeParameter
|
||||
import org.jetbrains.kotlin.types.typeUtil.isUnit
|
||||
|
||||
class ConvertLambdaToReferenceInspection() : IntentionBasedInspection<KtLambdaExpression>(
|
||||
class ConvertLambdaToReferenceInspection : IntentionBasedInspection<KtLambdaExpression>(
|
||||
ConvertLambdaToReferenceIntention::class,
|
||||
{ it -> ConvertLambdaToReferenceIntention.shouldSuggestToConvert(it) }
|
||||
) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
|
||||
class IntroduceBackingPropertyIntention(): SelfTargetingIntention<KtProperty>(KtProperty::class.java, "Introduce backing property") {
|
||||
class IntroduceBackingPropertyIntention : SelfTargetingIntention<KtProperty>(KtProperty::class.java, "Introduce backing property") {
|
||||
override fun isApplicableTo(element: KtProperty, caretOffset: Int): Boolean {
|
||||
if (!canIntroduceBackingProperty(element)) return false
|
||||
return element.nameIdentifier?.textRange?.containsOffset(caretOffset) == true
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ class RemoveEmptySecondaryConstructorBodyInspection : IntentionBasedInspection<K
|
||||
get() = ProblemHighlightType.LIKE_UNUSED_SYMBOL
|
||||
}
|
||||
|
||||
class RemoveEmptySecondaryConstructorBodyIntention() : SelfTargetingOffsetIndependentIntention<KtBlockExpression>(KtBlockExpression::class.java, "Remove empty constructor body") {
|
||||
class RemoveEmptySecondaryConstructorBodyIntention : SelfTargetingOffsetIndependentIntention<KtBlockExpression>(KtBlockExpression::class.java, "Remove empty constructor body") {
|
||||
|
||||
override fun applyTo(element: KtBlockExpression, editor: Editor?) = element.delete()
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.endOffset
|
||||
import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
||||
|
||||
class RemoveSetterParameterTypeInspection()
|
||||
: IntentionBasedInspection<KtCallableDeclaration>(
|
||||
class RemoveSetterParameterTypeInspection : IntentionBasedInspection<KtCallableDeclaration>(
|
||||
RemoveExplicitTypeIntention::class,
|
||||
{ it -> RemoveExplicitTypeIntention.isSetterParameter(it) }
|
||||
) {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
|
||||
class ReplaceExplicitFunctionLiteralParamWithItIntention() : PsiElementBaseIntentionAction() {
|
||||
class ReplaceExplicitFunctionLiteralParamWithItIntention : PsiElementBaseIntentionAction() {
|
||||
override fun getFamilyName() = "Replace explicit lambda parameter with 'it'"
|
||||
|
||||
override fun isAvailable(project: Project, editor: Editor, element: PsiElement): Boolean {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.psi.KtNameReferenceExpression
|
||||
import org.jetbrains.kotlin.psi.KtPsiFactory
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
|
||||
class ReplaceItWithExplicitFunctionLiteralParamIntention() : SelfTargetingOffsetIndependentIntention<KtNameReferenceExpression> (
|
||||
class ReplaceItWithExplicitFunctionLiteralParamIntention : SelfTargetingOffsetIndependentIntention<KtNameReferenceExpression> (
|
||||
KtNameReferenceExpression::class.java, "Replace 'it' with explicit parameter"
|
||||
), LowPriorityAction {
|
||||
override fun isApplicableTo(element: KtNameReferenceExpression)
|
||||
|
||||
+1
-1
@@ -16,5 +16,5 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.intentions
|
||||
|
||||
class ReplaceMathMaxWithCoerceAtLeastIntention() :
|
||||
class ReplaceMathMaxWithCoerceAtLeastIntention :
|
||||
ReplaceMathMethodsWithKotlinNativeMethodsIntention("Replace Math.max with coerceAtLeast", "coerceAtLeast", "max")
|
||||
+1
-1
@@ -38,7 +38,7 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.types.expressions.OperatorConventions
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||
|
||||
class ReplaceCallWithComparisonInspection() : IntentionBasedInspection<KtDotQualifiedExpression>(
|
||||
class ReplaceCallWithComparisonInspection : IntentionBasedInspection<KtDotQualifiedExpression>(
|
||||
ReplaceCallWithBinaryOperatorIntention::class,
|
||||
{ qualifiedExpression ->
|
||||
val calleeExpression = qualifiedExpression.callExpression?.calleeExpression as? KtSimpleNameExpression
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
||||
|
||||
class KDocTypedHandler(): TypedHandlerDelegate() {
|
||||
class KDocTypedHandler : TypedHandlerDelegate() {
|
||||
override fun beforeCharTyped(c: Char, project: Project, editor: Editor, file: PsiFile, fileType: FileType): TypedHandlerDelegate.Result {
|
||||
if (overwriteClosingBracket(c, editor, file)) {
|
||||
EditorModificationUtil.moveCaretRelatively(editor, 1)
|
||||
|
||||
@@ -72,7 +72,7 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||
import java.util.*
|
||||
|
||||
sealed class ContainerInfo() {
|
||||
sealed class ContainerInfo {
|
||||
abstract val fqName: FqName?
|
||||
abstract fun matches(descriptor: DeclarationDescriptor): Boolean
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.kotlin.idea.util.ProjectRootsUtil
|
||||
import org.jetbrains.kotlin.load.kotlin.PackagePartClassUtils
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
|
||||
class RenameKotlinFileProcessor() : RenamePsiFileProcessor() {
|
||||
class RenameKotlinFileProcessor : RenamePsiFileProcessor() {
|
||||
override fun canProcessElement(element: PsiElement) = element is KtFile && ProjectRootsUtil.isInProjectSource(element)
|
||||
|
||||
override fun prepareRenaming(element: PsiElement?,
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import com.intellij.util.Processor
|
||||
import org.jetbrains.kotlin.idea.references.mainReference
|
||||
import org.jetbrains.kotlin.idea.search.usagesSearch.processDelegationCallConstructorUsages
|
||||
|
||||
class KotlinConstructorDelegationCallReferenceSearcher() : QueryExecutorBase<PsiReference, SearchParameters>(true) {
|
||||
class KotlinConstructorDelegationCallReferenceSearcher : QueryExecutorBase<PsiReference, SearchParameters>(true) {
|
||||
override fun processQuery(queryParameters: SearchParameters, consumer: Processor<PsiReference>) {
|
||||
val method = queryParameters.method
|
||||
if (!method.isConstructor) return
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import com.intellij.psi.search.searches.MethodReferencesSearch
|
||||
import com.intellij.util.Processor
|
||||
import org.jetbrains.kotlin.idea.search.usagesSearch.OperatorReferenceSearcher
|
||||
|
||||
class KotlinConventionMethodReferencesSearcher() : QueryExecutorBase<PsiReference, MethodReferencesSearch.SearchParameters>(true) {
|
||||
class KotlinConventionMethodReferencesSearcher : QueryExecutorBase<PsiReference, MethodReferencesSearch.SearchParameters>(true) {
|
||||
override fun processQuery(queryParameters: MethodReferencesSearch.SearchParameters, consumer: Processor<PsiReference>) {
|
||||
val operatorSearcher = OperatorReferenceSearcher.create(
|
||||
queryParameters.method,
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.idea.stubindex.KotlinSourceFilterScope
|
||||
import org.jetbrains.kotlin.idea.stubindex.KotlinSuperClassIndex
|
||||
import org.jetbrains.kotlin.idea.util.application.runReadAction
|
||||
|
||||
open class KotlinDirectInheritorsSearcher() : QueryExecutorBase<PsiClass, DirectClassInheritorsSearch.SearchParameters>(true) {
|
||||
open class KotlinDirectInheritorsSearcher : QueryExecutorBase<PsiClass, DirectClassInheritorsSearch.SearchParameters>(true) {
|
||||
override fun processQuery(queryParameters: DirectClassInheritorsSearch.SearchParameters, consumer: Processor<PsiClass>) {
|
||||
val baseClass = queryParameters.classToProcess
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||
import org.jetbrains.kotlin.synthetic.JavaSyntheticPropertiesScope
|
||||
import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor
|
||||
|
||||
class KotlinPropertyAccessorsReferenceSearcher() : QueryExecutorBase<PsiReference, MethodReferencesSearch.SearchParameters>(true) {
|
||||
class KotlinPropertyAccessorsReferenceSearcher : QueryExecutorBase<PsiReference, MethodReferencesSearch.SearchParameters>(true) {
|
||||
override fun processQuery(queryParameters: MethodReferencesSearch.SearchParameters, consumer: Processor<PsiReference>) {
|
||||
val method = queryParameters.method
|
||||
val onlyKotlinFiles = queryParameters.effectiveSearchScope.restrictToKotlinSources()
|
||||
|
||||
@@ -166,7 +166,7 @@ class ValueWhenEntrySelector(val expression: Expression) : WhenEntrySelector() {
|
||||
}
|
||||
}
|
||||
|
||||
class ElseWhenEntrySelector() : WhenEntrySelector() {
|
||||
class ElseWhenEntrySelector : WhenEntrySelector() {
|
||||
override fun generateCode(builder: CodeBuilder) {
|
||||
builder.append("else")
|
||||
}
|
||||
|
||||
@@ -52,12 +52,12 @@ abstract class MayBeNullableType(nullability: Nullability, val settings: Convert
|
||||
get() = if (isNullable) "?" else ""
|
||||
}
|
||||
|
||||
abstract class NotNullType() : Type() {
|
||||
abstract class NotNullType : Type() {
|
||||
override val isNullable: Boolean
|
||||
get() = false
|
||||
}
|
||||
|
||||
abstract class Type() : Element() {
|
||||
abstract class Type : Element() {
|
||||
abstract val isNullable: Boolean
|
||||
|
||||
open fun toNotNullType(): Type = this
|
||||
@@ -132,7 +132,7 @@ class OutProjectionType(val bound: Type) : NotNullType() {
|
||||
}
|
||||
}
|
||||
|
||||
class StarProjectionType() : NotNullType() {
|
||||
class StarProjectionType : NotNullType() {
|
||||
override fun generateCode(builder: CodeBuilder) {
|
||||
builder.append("*")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user