Skip to content
Merged
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
@@ -0,0 +1,4 @@
{
"type" : "bugfix",
"description" : "Fix LinkageError while attempting to do Amazon Q inline suggestions in certain environments"
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ enum class ChangeType(val sectionTitle: String) {

class Serializer : StdSerializer<ChangeType>(ChangeType::class.java) {
override fun serialize(value: ChangeType, gen: JsonGenerator?, provider: SerializerProvider?) {
gen?.writeString(value.name.toLowerCase())
gen?.writeString(value.name.lowercase())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ open class NewChange : ChangeLogTask() {
)
}

private fun newFile(changeType: ChangeType) = nextReleaseDirectory.file("${changeType.name.toLowerCase()}-${UUID.randomUUID()}.json").get().asFile.apply {
private fun newFile(changeType: ChangeType) = nextReleaseDirectory.file("${changeType.name.lowercase()}-${UUID.randomUUID()}.json").get().asFile.apply {
parentFile?.mkdirs()
createNewFile()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ configurations {

// Exclude dependencies that ship with iDE
exclude(group = "org.slf4j")
// we want kotlinx-coroutines-debug and kotlinx-coroutines-test
exclude(group = "org.jetbrains.kotlinx", "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", "kotlinx-coroutines-core")
if (!name.startsWith("kotlinCompiler") && !name.startsWith("generateModels") && !name.startsWith("rdGen")) {
// we want kotlinx-coroutines-debug and kotlinx-coroutines-test
exclude(group = "org.jetbrains.kotlinx", "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", "kotlinx-coroutines-core")
}

resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlinx" && requested.name.startsWith("kotlinx-coroutines")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ configurations {

// Make sure we exclude stuff we either A) ships with IDE, B) we don't use to cut down on size
runtimeClasspath {
exclude(group = "org.slf4j")
exclude(group = "com.google.code.gson")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package is included only in certain environments right but we exclude it in all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it does not hurt

exclude(group = "org.slf4j", module = "slf4j-jdk14")
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.jetbrains.kotlinx")
}
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ junit4 = "4.13.2"
junit5 = "5.11.0"
# https://plugins.jetbrains.com/docs/intellij/kotlin.html#adding-kotlin-support
# https://kotlinlang.org/docs/releases.html#release-details
kotlin = "2.0.0"
kotlin = "2.1.20"
# set in <root>/settings.gradle.kts
kotlinCoroutines = "1.8.0"
lsp4j = "0.24.0"
mockito = "5.12.0"
mockitoKotlin = "5.4.0"
mockk = "1.13.17"
Expand Down Expand Up @@ -105,6 +106,7 @@ kotlin-coroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-tes
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlin-stdLibJdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
lsp4j = { module = "org.eclipse.lsp4j:org.eclipse.lsp4j", version.ref = "lsp4j" }
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" }
mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" }
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockitoKotlin" }
Expand Down
1 change: 1 addition & 0 deletions plugins/amazonq/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies {
implementation(project(":plugin-amazonq:codewhisperer"))
implementation(project(":plugin-amazonq:mynah-ui"))
implementation(project(":plugin-amazonq:shared"))
implementation(libs.lsp4j)

testImplementation(project(":plugin-core"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ object CodeWhispererTestUtil {
const val leftContext_success_Iac = "# Create an S3 Bucket named CodeWhisperer in CloudFormation"
const val leftContext_failure_Iac = "Create an S3 Bucket named CodeWhisperer"

internal fun pythonResponseWithToken(token: String): GenerateCompletionsResponse =
fun pythonResponseWithToken(token: String): GenerateCompletionsResponse =
pythonResponse.toBuilder().nextToken(token).build()

internal fun generateMockCompletionDetail(content: String): Completion {
fun generateMockCompletionDetail(content: String): Completion {
val referenceInfo = getReferenceInfo()
return Completion.builder().content(content)
.references(
Expand All @@ -184,9 +184,9 @@ object CodeWhispererTestUtil {
.build()
}

internal fun getReferenceInfo() = testReferenceInfoPair[Random.nextInt(testReferenceInfoPair.size)]
fun getReferenceInfo() = testReferenceInfoPair[Random.nextInt(testReferenceInfoPair.size)]

internal fun generateMockCompletionDetail(
fun generateMockCompletionDetail(
content: String,
licenseName: String,
repository: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import kotlin.test.fail
open class CodeWhispererImportAdderTestBase(
val importAdder: CodeWhispererImportAdder,
@Rule @JvmField val projectRule: CodeInsightTestFixtureRule,
internal val fileExtension: String,
val fileExtension: String,
) {

fun <T> testCreateNewImportPsiElementReturnValueForStatements(
Expand Down
1 change: 1 addition & 0 deletions plugins/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
implementation(project(":plugin-core:resources"))
implementation(project(":plugin-core:sdk-codegen"))
implementation(project(":plugin-core:webview"))
implementation(libs.slf4j.api)
}

tasks.check {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fun formatText(project: Project, language: Language, content: String): String {
* Designed to convert underscore separated words (e.g. UPDATE_COMPLETE) into title cased human readable text
* (e.g. Update Complete)
*/
fun String.toHumanReadable() = StringUtil.toTitleCase(toLowerCase().replace('_', ' '))
fun String.toHumanReadable() = StringUtil.toTitleCase(lowercase().replace('_', ' '))

fun generateUnifiedPatch(patch: String, filePath: String): TextFilePatch {
val unifiedPatch = "--- $filePath\n+++ $filePath\n$patch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class AwsResourceCacheTest {
whenever(mockResource.fetch(any())).thenReturn("hello")
val viewResource = Resource.view(mockResource) { toList() }

val filteredAndMapped = viewResource.filter { it != 'l' }.map { it.toUpperCase() }
val filteredAndMapped = viewResource.filter { it != 'l' }.map { it.uppercaseChar() }
assertThat(sut.getResource(filteredAndMapped, connectionSettings)).hasValue(listOf('H', 'E', 'O'))

val find = viewResource.find { it == 'l' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PathMapper(private val mappings: List<PathMapping>) {

fun normalizeLocal(localPath: String): String {
val updatedPath = if (SystemInfo.isWindows) {
localPath.toLowerCase()
localPath.lowercase()
} else {
localPath
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface CloudFormationTemplate {
}

private fun isYaml(templateFile: VirtualFile): Boolean = templateFile.fileType == YAMLFileType.YML ||
templateFile.extension?.toLowerCase() in YAML_EXTENSIONS
templateFile.extension?.lowercase() in YAML_EXTENSIONS

private val YAML_EXTENSIONS = setOf("yaml", "yml")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
message(
"dynamic_resources.operation_status_notification_title",
state.resourceIdentifier ?: state.resourceType,
state.operation.name.toLowerCase()
state.operation.name.lowercase()
),
message(
"dynamic_resources.operation_status_success",
state.resourceIdentifier ?: state.resourceType,
state.operation.name.toLowerCase()
state.operation.name.lowercase()
),
project
)
Expand All @@ -48,7 +48,7 @@
message(
"dynamic_resources.operation_status_failed_no_message",
state.resourceIdentifier ?: state.resourceType,
state.operation.name.toLowerCase()
state.operation.name.lowercase()

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

View check run for this annotation

Codecov / codecov/patch

plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/dynamic/DynamicResourceStateChangedNotificationHandler.kt#L51

Added line #L51 was not covered by tests
)
)
} else {
Expand All @@ -57,7 +57,7 @@
message(
"dynamic_resources.operation_status_failed",
state.resourceIdentifier ?: state.resourceType,
state.operation.name.toLowerCase(),
state.operation.name.lowercase(),

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

View check run for this annotation

Codecov / codecov/patch

plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/dynamic/DynamicResourceStateChangedNotificationHandler.kt#L60

Added line #L60 was not covered by tests
state.message
)
)
Expand All @@ -79,7 +79,7 @@
message(
"dynamic_resources.operation_status_notification_title",
state.resourceIdentifier ?: state.resourceType,
state.operation.name.toLowerCase()
state.operation.name.lowercase()

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

View check run for this annotation

Codecov / codecov/patch

plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/dynamic/DynamicResourceStateChangedNotificationHandler.kt#L82

Added line #L82 was not covered by tests
),
errorMessage,
project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
message(
"dynamic_resources.operation_status_notification_title",
dynamicResourceIdentifier.resourceIdentifier,
message("general.delete").toLowerCase()
message("general.delete").lowercase()

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

View check run for this annotation

Codecov / codecov/patch

plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/dynamic/DynamicResourcesUpdateManager.kt#L53

Added line #L53 was not covered by tests
),
project
)
Expand Down Expand Up @@ -80,7 +80,7 @@
message(
"dynamic_resources.operation_status_notification_title",
dynamicResourceIdentifier.resourceIdentifier,
message("dynamic_resources.editor.submitResourceUpdateRequest_text").toLowerCase()
message("dynamic_resources.editor.submitResourceUpdateRequest_text").lowercase()

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

View check run for this annotation

Codecov / codecov/patch

plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/dynamic/DynamicResourcesUpdateManager.kt#L83

Added line #L83 was not covered by tests
),
project
)
Expand Down Expand Up @@ -152,7 +152,7 @@
message(
"dynamic_resources.operation_status_notification_title",
mutation.resourceIdentifier ?: mutation.resourceType,
mutation.operation.name.toLowerCase()
mutation.operation.name.lowercase()
),
project
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SchemaCodeGenUtils {
if (builder.isNotEmpty()) {
builder.append(IdentifierFormatter.PACKAGE_SEPARATOR)
}
builder.append(IdentifierFormatter.toValidIdentifier(segment.toLowerCase()))
builder.append(IdentifierFormatter.toValidIdentifier(segment.lowercase()))
return this
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
TreeSpeedSearch.installOn(
tree,
false,
Function<TreePath, String> { obj ->
Function<TreePath, String?> { obj ->

Check notice on line 163 in plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/s3/editor/S3TreeTable.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unnecessary type argument

Remove explicit type arguments

Check notice

Code scanning / QDJVMC

Unnecessary type argument Note

Remove explicit type arguments
val node = obj.lastPathComponent as DefaultMutableTreeNode
val userObject = node.userObject as? S3TreeNode ?: return@Function null
return@Function if (userObject !is S3TreeContinuationNode<*>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ResourceSelector<T> private constructor(
setEditable(false)

if (sortOnLoad) {
model.replaceAll(value.sortedBy { it.toString().toLowerCase() })
model.replaceAll(value.sortedBy { it.toString().lowercase() })
} else {
model.replaceAll(value.toList())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// TODO: probably need to model the @sha:[...] case better
val (productCode, buildNumber) = ide.runtime().substringAfter("$JB_ECR_DOMAIN/").split(':', limit = 2)

productCode.substringBefore("@sha").toUpperCase() to buildNumber
productCode.substringBefore("@sha").uppercase() to buildNumber

Check warning on line 40 in plugins/toolkit/jetbrains-gateway/src/software/aws/toolkits/jetbrains/gateway/Workspace.kt

View check run for this annotation

Codecov / codecov/patch

plugins/toolkit/jetbrains-gateway/src/software/aws/toolkits/jetbrains/gateway/Workspace.kt#L40

Added line #L40 was not covered by tests
}

val platformProduct = build?.let { IntelliJPlatformProduct.fromProductCode(it.first) }
Expand Down
2 changes: 1 addition & 1 deletion plugins/toolkit/jetbrains-rider/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ tasks.withType<DetektCreateBaselineTask>().configureEach {
}

configurations.all {
if (name.contains("detekt")) {
if (name.contains("detekt") || name.contains("kotlinCompiler") || name.contains("rdGen")) {
return@all
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class GoLocalRunConfigurationIntegrationTest(private val runtime: LambdaRuntime)
val executeLambda = executeRunConfigurationAndWait(runConfiguration, DefaultDebugExecutor.EXECUTOR_ID)

assertThat(executeLambda.exitCode).isEqualTo(0)
assertThat(executeLambda.stdout).contains(input.toUpperCase())
assertThat(executeLambda.stdout).contains(input.uppercase())

assertThat(debuggerIsHit.get()).isTrue
}
Expand Down Expand Up @@ -281,7 +281,7 @@ class GoLocalRunConfigurationIntegrationTest(private val runtime: LambdaRuntime)
runtime = runtime,
mockCredentialsId = mockId,
input = input,
expectedOutput = input.toUpperCase()
expectedOutput = input.uppercase()
)

@Test
Expand Down
Loading