-
Notifications
You must be signed in to change notification settings - Fork 251
feat(amazonq): Add quick actions to Flare chat #5561
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
…Flare' into manodnyb/setupChatComponentsWithFlare
…Flare' into manodnyb/setupChatComponentsWithFlare
Qodana Community for JVM7 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
|
@@ -17,6 +17,7 @@ | |||
import kotlinx.coroutines.flow.launchIn | |||
import kotlinx.coroutines.flow.merge | |||
import kotlinx.coroutines.flow.onEach | |||
import kotlinx.coroutines.future.await |
Check warning
Code scanning / QDJVMC
Unused import directive Warning
...tware/aws/toolkits/jetbrains/services/amazonq/lsp/flareChat/AwsServerCapabilitiesProvider.kt
Fixed
Show fixed
Hide fixed
...tware/aws/toolkits/jetbrains/services/amazonq/lsp/flareChat/AwsServerCapabilitiesProvider.kt
Show resolved
Hide resolved
/retryBuilds |
...ftware/aws/toolkits/jetbrains/services/amazonq/lsp/flareChat/AmazonQLspTypeAdapterFactory.kt
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
class AwsExtendedInitializeResult : InitializeResult() { |
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.
data class
...ftware/aws/toolkits/jetbrains/services/amazonq/lsp/flareChat/AmazonQLspTypeAdapterFactory.kt
Outdated
Show resolved
Hide resolved
private val serverStartedListener = mutableListOf<AmazonQServerStartedListener>() | ||
fun addServerStartedListener(listener: AmazonQServerStartedListener) = serverStartedListener.add(listener) | ||
fun notifyServerStarted() = serverStartedListener.forEach { it() } |
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.
would prefer to have a flag that can be queried by consumers to handle the case where the server exits unexpectedly
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 has been renamed incorrectly. This listens to when we receive an initialize message and is separate from starting servers. Monitoring server state will be executed separately
encryptionManager: JwtEncryptionManager?, | ||
browser: Browser, | ||
) { | ||
result.whenComplete { value, error -> |
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.
need to handle error
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.
...ains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt
Outdated
Show resolved
Hide resolved
customMessageTracer.trace("INCOMING", message) | ||
if (message is ResponseMessage && message.result is AwsExtendedInitializeResult) { | ||
val result = message.result as AwsExtendedInitializeResult | ||
AwsServerCapabilitiesProvider.getInstance(project).setAwsServerCapabilities(result.getAwsServerCapabilities()) |
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.
we already expose capabilities on the service
AmazonQLspServer.getInstance(project).capabilities.serverCapabilities
?
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.
Want to keep this in place to be able to access other agents potentially from this map
...-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageServer.kt
Outdated
Show resolved
Hide resolved
...s-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt
Outdated
Show resolved
Hide resolved
val partialResultToken = chatCommunicationManager.addPartialChatMessage(tabId) | ||
var encryptionManager: JwtEncryptionManager? = null | ||
val result = AmazonQLspService.executeIfRunning(project) { server -> | ||
encryptionManager = this.encryptionManager |
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.
if we are extracting the encryptionManager, we might as well capture the server instance so that we don't need to fetch it on every invocation
...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
} | ||
} | ||
|
||
class AwsExtendedInitializeResult(awsServerCapabilities: AwsServerCapabilities? = null) : InitializeResult() { |
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.
data class
@@ -20,7 +20,7 @@ | |||
|
|||
class MessageSerializer @VisibleForTesting constructor() { | |||
|
|||
private val objectMapper = jacksonObjectMapper() | |||
val objectMapper = jacksonObjectMapper() |
Check notice
Code scanning / QDJVMC
Function or property has platform type Note
@@ -19,6 +19,7 @@ | |||
import com.intellij.openapi.util.Disposer | |||
import com.intellij.openapi.util.Key | |||
import com.intellij.openapi.util.SystemInfo | |||
import com.intellij.util.animation.consumer |
Check warning
Code scanning / QDJVMC
Unused import directive Warning
@@ -40,6 +41,10 @@ | |||
import org.eclipse.lsp4j.TextDocumentClientCapabilities | |||
import org.eclipse.lsp4j.WorkspaceClientCapabilities | |||
import org.eclipse.lsp4j.jsonrpc.Launcher | |||
import org.eclipse.lsp4j.jsonrpc.Launcher.Builder |
Check warning
Code scanning / QDJVMC
Unused import directive Warning
@@ -348,7 +373,21 @@ | |||
} | |||
} | |||
|
|||
class MessageTracer { |
Check warning
Code scanning / QDJVMC
Unused symbol Warning
class MessageTracer { | ||
private val traceLogger = LOG.atLevel(if (isDeveloperMode()) Level.INFO else Level.DEBUG) | ||
|
||
fun trace(direction: String, message: Message) { |
Check warning
Code scanning / QDJVMC
Unused symbol Warning
/retryBuilds |
Description
Ability to add quick actions
Added /help and /clear actions
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.