-
Notifications
You must be signed in to change notification settings - Fork 260
feat(amazonQ): LSP -- Implement Initialize message #5367
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
val metadata = ClientMetadata.getDefault() | ||
return mapOf( | ||
"aws" to mapOf( | ||
"clientInfo" to mapOf( | ||
"extension" to mapOf( | ||
"name" to metadata.awsProduct.toString(), | ||
"version" to metadata.awsVersion | ||
), | ||
"clientId" to metadata.clientId, | ||
"version" to metadata.parentProductVersion, | ||
"name" to metadata.parentProduct | ||
) | ||
) | ||
) | ||
} |
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.
can we model this as a data class instead of a free form map
} | ||
|
||
private fun createWorkspaceFolders(): List<WorkspaceFolder> { | ||
return project.basePath?.let { basePath -> |
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.
add a note to handle the case where this is null
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
...ains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt
Outdated
Show resolved
Hide resolved
...ains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt
Outdated
Show resolved
Hide resolved
// workspace folders? | ||
// anything else we need? | ||
val initializeResult = try { | ||
withTimeout(Duration.ofSeconds(30)) { |
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.
where does this 30 come from?
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.
arbitrary -- saw your //comment about having a timeout and thought we should have something
can change to retry with backoff pattern or something else, just wasn't sure what was appropriate here.
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.
5-10s is probably good enough. if it doesn't spin up quickly we should kill server and retry, then fail after some # of attempts. can you log that as a separate task on the board?
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
Creates the initialization parameters for the Amazon Q LSP connection
Types of changes
Description
Initialize message is the first request sent from the client and sets up the LSP session configuration for subsequent communications.
Includes:
***needs tests, not currently working
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.