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
Expand Up @@ -23,10 +23,6 @@

<extensions defaultExtensionNs="amazon.q">
<appFactory implementation="software.aws.toolkits.jetbrains.services.cwc.AppFactory" />
<appFactory implementation="software.aws.toolkits.jetbrains.services.amazonqFeatureDev.FeatureDevAppFactory" />
<appFactory implementation="software.aws.toolkits.jetbrains.services.amazonqDoc.DocAppFactory" />
<appFactory implementation="software.aws.toolkits.jetbrains.services.amazonqCodeScan.CodeScanChatAppFactory" />
<appFactory implementation="software.aws.toolkits.jetbrains.services.amazonqCodeTest.CodeTestChatAppFactory" />
</extensions>

<actions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,8 @@ class CodeWhispererCodeScanManager(val project: Project, private val defaultScop
*/
fun isOnDemandScanInProgress(): Boolean = isOnDemandScanInProgress.get()

/**
* Code scan job is active when the [Job] is started and is in active state.
*/
fun isCodeScanJobActive(): Boolean = this::codeScanJob.isInitialized && codeScanJob.isActive && isOnDemandScanInProgress()

fun getRunActionButtonIcon(): Icon = if (isOnDemandScanInProgress()) AllIcons.Process.Step_1 else AllIcons.Actions.Execute

fun getActionButtonIconForExplorerNode(): Icon = if (isOnDemandScanInProgress()) AllIcons.Actions.Suspend else AllIcons.Actions.Execute

fun getActionButtonText(): String = if (!isOnDemandScanInProgress()) {
message(
"codewhisperer.codescan.run_scan",
INACTIVE_TEXT_COLOR
)
} else {
message("codewhisperer.codescan.stop_scan")
}

private fun isIgnoredIssueTitle(title: String) = getIgnoredIssueTitles().contains(title)

fun isIgnoredIssue(title: String, document: Document, file: VirtualFile, startLine: Int) = isIgnoredIssueTitle(title) ||
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import software.aws.toolkits.jetbrains.services.amazonq.profile.QRegionProfileMa
import software.aws.toolkits.jetbrains.services.codewhisperer.actions.CodeWhispererConnectOnGithubAction
import software.aws.toolkits.jetbrains.services.codewhisperer.actions.CodeWhispererLearnMoreAction
import software.aws.toolkits.jetbrains.services.codewhisperer.actions.CodeWhispererProvideFeedbackAction
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.actions.CodeWhispererCodeScanRunAction
import software.aws.toolkits.jetbrains.services.codewhisperer.explorer.actions.ActionProvider
import software.aws.toolkits.jetbrains.services.codewhisperer.explorer.actions.Customize
import software.aws.toolkits.jetbrains.services.codewhisperer.explorer.actions.Learn
Expand All @@ -41,7 +40,6 @@ class QStatusBarLoggedInActionGroup : DefaultActionGroup() {
override val customize = Customize()
override val learn = Learn()
override val openChatPanel = ActionManager.getInstance().getAction("q.openchat")
override val runScan = CodeWhispererCodeScanRunAction()
override val pauseAutoScans = PauseCodeScans()
override val resumeAutoScans = ResumeCodeScans()
override val sendFeedback = CodeWhispererProvideFeedbackAction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ interface ActionProvider<T> {
val openChatPanel: T
val pauseAutoScans: T
val resumeAutoScans: T
val runScan: T
val sendFeedback: T
val connectOnGithub: T
val documentation: T
Expand Down Expand Up @@ -53,7 +52,6 @@ fun <T> buildActionListForCodeScan(project: Project, actionProvider: ActionProvi
add(actionProvider.resumeAutoScans)
}
}
add(actionProvider.runScan)
}

fun <T> buildActionListForOtherFeatures(project: Project, actionProvider: ActionProvider<T>): List<T> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,9 @@ export class Connector {
private processUserGuideLink(tabType: TabType, actionId: string) {
let userGuideLink = ''
switch (tabType) {
case 'codescan':
userGuideLink = codeScanUserGuide
break
case 'codetest':
userGuideLink = codeTestUserGuide
break
case 'codetransform':
userGuideLink = codeTransformUserGuide
break
case 'doc':
userGuideLink = docUserGuide
break
case 'featuredev':
userGuideLink = featureDevUserGuide
break
}

// e.g. amazonq-explore-user-guide-featuredev
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*!
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need these connector files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No I wrote a TODO to remove all these in next PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to this PR to be large and this defeats the purpose instead I will raise a separate PR cleaning all the / agents files

* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

import {ExtensionMessage} from "../commands";
import {ChatPayload, ConnectorProps} from "../connector";
import {FormButtonIds} from "../forms/constants";
import {ChatItem, ChatItemAction, ChatItemType, FeedbackPayload, MynahIcons, MynahUIDataModel} from '@aws/mynah-ui-chat'
import {CodeReference} from "./amazonqCommonsConnector";
import {Status} from "@aws/mynah-ui-chat/dist/static";
import {EmptyMynahUIDataModel} from "@aws/mynah-ui-chat/dist/helper/store";
import {doesNotMatch} from "node:assert";

export interface ICodeTestChatConnectorProps {
sendMessageToExtension: (message: ExtensionMessage) => void
Expand Down
18 changes: 0 additions & 18 deletions plugins/amazonq/mynah-ui/src/mynah-ui/ui/apps/docChatConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,6 @@ export class Connector {
canBeVoted: false,
})

this.onChatAnswerReceived(messageData.tabID, {
type: ChatItemType.SYSTEM_PROMPT,
body: undefined,
followUp: this.followUpGenerator.generateAuthFollowUps('doc', messageData.authType),
canBeVoted: false,
})

return
}

Expand Down Expand Up @@ -319,17 +312,6 @@ export class Connector {
)
return
}

if (messageData.type === 'authNeededException') {
this.processAuthNeededException(messageData)
return
}

if (messageData.type === 'openNewTabMessage') {
this.onNewTab('doc')
return
}

if (messageData.type === 'updatePromptProgress') {
this.onUpdatePromptProgress(messageData.tabId, messageData.progressField)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export class Connector {
private readonly chatInputEnabled
private readonly onUpdateAuthentication
private readonly followUpGenerator: FollowUpGenerator
private readonly onNewTab
private readonly onFileComponentUpdate

constructor(props: ConnectorProps) {
Expand All @@ -64,7 +63,6 @@ export class Connector {
this.chatInputEnabled = props.onChatInputEnabled
this.onUpdateAuthentication = props.onUpdateAuthentication
this.followUpGenerator = new FollowUpGenerator()
this.onNewTab = props.onNewTab
this.onFileComponentUpdate = props.onFileComponentUpdate
}

Expand Down Expand Up @@ -173,27 +171,6 @@ export class Connector {
}
}

private processAuthNeededException = async (messageData: any): Promise<void> => {
if (this.onChatAnswerReceived === undefined) {
return
}

this.onChatAnswerReceived(messageData.tabID, {
type: ChatItemType.ANSWER,
body: messageData.message,
followUp: undefined,
canBeVoted: false,
})

this.onChatAnswerReceived(messageData.tabID, {
type: ChatItemType.SYSTEM_PROMPT,
body: undefined,
followUp: this.followUpGenerator.generateAuthFollowUps('featuredev', messageData.authType),
canBeVoted: false,
})

return
}

private createAnswer = (messageData: any): ChatItem => {
return {
Expand Down Expand Up @@ -274,16 +251,6 @@ export class Connector {
)
return
}

if (messageData.type === 'authNeededException') {
this.processAuthNeededException(messageData)
return
}

if (messageData.type === 'openNewTabMessage') {
this.onNewTab('featuredev')
return
}
}

onStopChatResponse = (tabID: string): void => {
Expand Down
Loading
Loading