-
Notifications
You must be signed in to change notification settings - Fork 274
feat(amazonq): Added changes for override lsp artifacts #5429
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
Changes from 10 commits
d2795d1
30ce060
aaca577
5a4dc9e
6b49fc8
c4ec818
a2ef3b0
b11347d
7f009bd
5e9fa9d
1ff048a
2d99e46
7df6549
aefe915
293423d
61188ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package software.aws.toolkits.jetbrains.settings | ||
|
|
||
| import com.intellij.openapi.components.PersistentStateComponent | ||
| import com.intellij.openapi.components.RoamingType | ||
| import com.intellij.openapi.components.Service | ||
| import com.intellij.openapi.components.State | ||
| import com.intellij.openapi.components.Storage | ||
| import com.intellij.openapi.components.service | ||
| import com.intellij.util.xmlb.annotations.Attribute | ||
|
|
||
| @Service | ||
|
Check warning on line 14 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
LokeshDogga13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @State(name = "lspSettings", storages = [Storage("aws.xml", roamingType = RoamingType.DISABLED)]) | ||
| class LspSettings : PersistentStateComponent<LspConfiguration> { | ||
| private var state = LspConfiguration() | ||
|
Check warning on line 17 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
|
|
||
| override fun getState(): LspConfiguration = state | ||
|
Check warning on line 19 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
|
|
||
| override fun loadState(state: LspConfiguration) { | ||
| this.state = state | ||
| } | ||
|
Check warning on line 23 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
|
|
||
| fun getArtifactPath() = run { | ||
| when { | ||
|
Check warning on line 26 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
| state.artifactPath == null -> "" | ||
| else -> state.artifactPath.toString() | ||
| } | ||
| } | ||
|
Check warning on line 30 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
|
|
||
| fun setExecutablePath(artifactPath: String?) { | ||
| if (artifactPath == null) { | ||
| state.artifactPath = "" | ||
|
Check warning on line 34 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
| } else { | ||
| state.artifactPath = artifactPath | ||
|
Check warning on line 36 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
| } | ||
| } | ||
|
Check warning on line 38 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
|
|
||
| companion object { | ||
| fun getInstance(): LspSettings = service() | ||
|
Check warning on line 41 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
| } | ||
| } | ||
|
|
||
| data class LspConfiguration( | ||
LokeshDogga13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| @Attribute(value = "path") | ||
| var artifactPath: String? = null, | ||
| ) | ||
|
Check warning on line 48 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/settings/LspSettings.kt
|
||
Uh oh!
There was an error while loading. Please reload this page.