-
Notifications
You must be signed in to change notification settings - Fork 251
feat(lsp): Addition of LSP for Amazon Q #5593
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
Conversation
This is the initial iteration of the bare minimum of process management to interact with Amazon Q logic vended by Flare. It is a direct port of the exploratory work done in https://github.com/rli/lsp-exp/tree/master/src/main/kotlin/org/example/lsp4j Missing are tests and any sort of edge case handling
Initialize message is the first request sent from the client and sets up the LSP session configuration for subsequent communications. Includes: Process ID for server management Client capabilities for LSP features Client information (IDE/product details) Workspace folders for project context Extended client metadata specific to Amazon Q ***needs tests, not currently working
* workspaceFolderUtil only collects root module, not subfolders * detekt * detektTest --------- Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>
Qodana Community for JVM19 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFileDescriptor() | ||
fileChooserDescriptor.isForcedToUseIdeaFileChooser = true | ||
|
||
textFieldWithBrowseButton(fileChooserDescriptor = fileChooserDescriptor) |
Check warning
Code scanning / QDJVMC
Unstable API Usage Warning
@@ -116,6 +138,20 @@ | |||
} | |||
|
|||
group(message("aws.settings.codewhisperer.group.q_chat")) { | |||
row { | |||
checkBox(message("aws.settings.codewhisperer.workspace_context")).apply { |
Check warning
Code scanning / QDJVMC
Usage of redundant or deprecated syntax or deprecated symbols Warning
@Service(Service.Level.PROJECT) | ||
class AmazonQLspService(private val project: Project, private val cs: CoroutineScope) : Disposable { | ||
private var instance: Deferred<AmazonQServerInstance> | ||
val capabilities |
Check notice
Code scanning / QDJVMC
Function or property has platform type Note
@Service(Service.Level.PROJECT) | ||
class AmazonQLspService(private val project: Project, private val cs: CoroutineScope) : Disposable { | ||
private var instance: Deferred<AmazonQServerInstance> | ||
val capabilities |
Check warning
Code scanning / QDJVMC
Unused symbol Warning
override fun dispose() { | ||
} | ||
|
||
suspend fun restart() = mutex.withLock { |
Check warning
Code scanning / QDJVMC
Unused symbol Warning
PythonSdkUtil.findPythonSdk(module)?.let { sdk -> | ||
PythonSdkUtil.getSitePackagesDirectory(sdk)?.let { sitePackagesDir -> | ||
val packageManager = PythonPackageManager.forSdk(module.project, sdk) | ||
packageManager.installedPackages.forEach { pkg -> |
Check warning
Code scanning / QDJVMC
Unstable API Usage Warning
package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.dependencies | ||
|
||
class DidChangeDependencyPathsParams( | ||
val moduleName: String, |
Check warning
Code scanning / QDJVMC
Unused symbol Warning
|
||
class DidChangeDependencyPathsParams( | ||
val moduleName: String, | ||
val runtimeLanguage: String, |
Check warning
Code scanning / QDJVMC
Unused symbol Warning
val moduleName: String, | ||
val runtimeLanguage: String, | ||
val paths: List<String>, | ||
val includePatterns: List<String>, |
Check warning
Code scanning / QDJVMC
Unused symbol Warning
val runtimeLanguage: String, | ||
val paths: List<String>, | ||
val includePatterns: List<String>, | ||
val excludePatterns: List<String>, |
Check warning
Code scanning / QDJVMC
Unused symbol Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a merge (not squash) to avoid conflicts in outstanding nested features / PRs
// FIX_WHEN_MIN_IS_242 | ||
if (providers.gradleProperty("ideProfileName").get() == "2024.1") { | ||
implementation("org.eclipse.lsp4j:org.eclipse.lsp4j:0.24.0") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// FIX_WHEN_MIN_IS_242 | |
if (providers.gradleProperty("ideProfileName").get() == "2024.1") { | |
implementation("org.eclipse.lsp4j:org.eclipse.lsp4j:0.24.0") | |
} |
override fun telemetryEvent(`object`: Any) { | ||
println(`object`) | ||
} | ||
|
||
override fun publishDiagnostics(diagnostics: PublishDiagnosticsParams) { | ||
println(diagnostics) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
MessageType.Warning -> NotificationType.WARNING | ||
MessageType.Info, MessageType.Log -> NotificationType.INFORMATION | ||
} | ||
println("$type: ${messageParams.message}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger
} | ||
|
||
override fun showMessageRequest(requestParams: ShowMessageRequestParams): CompletableFuture<MessageActionItem?>? { | ||
println(requestParams) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println(requestParams) |
/retryBuilds |
Conflicts: plugins/amazonq/codewhisperer/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codewhisperer/CodeWhispererSettingsTest.kt
Merge main into feature/q-lsp
/retryBuilds |
Types of changes
Description
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.