Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve 'Kotlin object registered as extension' #4815

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import software.aws.toolkits.jetbrains.core.experiments.ToolkitExperiment
import software.aws.toolkits.resources.message

object PythonAwsConnectionExperiment : ToolkitExperiment(
class PythonAwsConnectionExperiment : ToolkitExperiment(

Check warning on line 9 in plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/execution/PythonAwsConnectionExperiment.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Extension class should be final and non-public

Extension class should not be public
"pythonRunConfigurationExtension",
{ message("run_configuration_extension.feature.python.title") },
{ message("run_configuration_extension.feature.python.description") },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@
}
}

object AwsLocalTerminalExperiment :
class AwsLocalTerminalExperiment :

Check warning on line 84 in plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/terminal/OpenAwsLocalTerminal.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Extension class should be final and non-public

Extension class should not be public
ToolkitExperiment("connectedLocalTerminal", { message("aws.terminal.action") }, { message("aws.terminal.action.tooltip") }, default = true)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import software.aws.toolkits.jetbrains.core.experiments.suggest
import software.aws.toolkits.resources.message

object JsonResourceModificationExperiment : ToolkitExperiment(
class JsonResourceModificationExperiment : ToolkitExperiment(

Check warning on line 16 in plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/dynamic/JsonResourceModificationExperiment.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Extension class should be final and non-public

Extension class should not be public
"jsonResourceModification",
{ message("dynamic_resources.experiment.title") },
{ message("dynamic_resources.experiment.description") }
Expand All @@ -22,7 +22,7 @@
class SuggestEditExperimentListener : FileEditorManagerListener {
override fun fileOpened(source: FileEditorManager, file: VirtualFile) {
if (file is DynamicResourceVirtualFile) {
JsonResourceModificationExperiment.suggest()
JsonResourceModificationExperiment().suggest()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import software.aws.toolkits.jetbrains.core.experiments.ToolkitExperiment
import software.aws.toolkits.resources.message

object EcsExecExperiment : ToolkitExperiment(
class EcsExecExperiment : ToolkitExperiment(

Check warning on line 9 in plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/ecs/EcsExecExperiment.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Extension class should be final and non-public

Extension class should not be public
"ecsExec",
{ message("ecs.execute_command.experiment.title") },
{ message("ecs.execute_command.experiment.description") },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.time.Duration
import kotlin.streams.asSequence

object SsmPlugin : ManagedToolType<FourPartVersion>, DocumentedToolType<FourPartVersion>, BaseToolType<FourPartVersion>() {
class SsmPlugin : ManagedToolType<FourPartVersion>, DocumentedToolType<FourPartVersion>, BaseToolType<FourPartVersion>() {

Check warning on line 31 in plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/ssm/SsmPlugin.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Extension class should be final and non-public

Extension class should not be public
private val hasDpkg by lazy { hasCommand("dpkg-deb") }
private val hasRpm2Cpio by lazy { hasCommand("rpm2cpio") }

Expand Down Expand Up @@ -133,9 +133,12 @@
val output = ExecUtil.execAndGetOutput(GeneralCommandLine("sh", "-c", "command -v $cmd"), EXECUTION_TIMEOUT.toMillis().toInt())
return output.exitCode == 0
}
private val LOGGER = getLogger<SsmPlugin>()
private const val BASE_URL = "https://s3.us-east-1.amazonaws.com/session-manager-downloads/plugin"
private const val VERSION_FILE = "$BASE_URL/latest/VERSION"
private val EXECUTION_TIMEOUT = Duration.ofSeconds(5)
private val INSTALL_TIMEOUT = Duration.ofSeconds(30)

companion object {

Check warning on line 137 in plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/ssm/SsmPlugin.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Companion object in extensions

Companion objects in IDE extension implementations may only contain a logger and constants
private val LOGGER = getLogger<SsmPlugin>()
private const val BASE_URL = "https://s3.us-east-1.amazonaws.com/session-manager-downloads/plugin"
private const val VERSION_FILE = "$BASE_URL/latest/VERSION"
private val EXECUTION_TIMEOUT = Duration.ofSeconds(5)
private val INSTALL_TIMEOUT = Duration.ofSeconds(30)
}
}
Loading