Skip to content

Commit 0c61b95

Browse files
authored
Merge branch 'main' into error-metric-fix
2 parents 2d32133 + 6e813fd commit 0c61b95

File tree

33 files changed

+624
-119
lines changed

33 files changed

+624
-119
lines changed

app/aws-lsp-antlr4-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"webpack": "webpack"
1313
},
1414
"dependencies": {
15-
"@aws/language-server-runtimes": "^0.2.74",
15+
"@aws/language-server-runtimes": "^0.2.76",
1616
"@aws/lsp-antlr4": "*",
1717
"antlr4-c3": "^3.4.1",
1818
"antlr4ng": "^3.0.4"

app/aws-lsp-codewhisperer-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"test": "node scripts/test-runner.js"
1414
},
1515
"dependencies": {
16-
"@aws/language-server-runtimes": "^0.2.74",
16+
"@aws/language-server-runtimes": "^0.2.76",
1717
"@aws/lsp-codewhisperer": "*",
1818
"copyfiles": "^2.4.1",
1919
"cross-env": "^7.0.3",

app/aws-lsp-identity-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"compile": "tsc --build"
88
},
99
"dependencies": {
10-
"@aws/language-server-runtimes": "^0.2.74",
10+
"@aws/language-server-runtimes": "^0.2.76",
1111
"@aws/lsp-identity": "^0.0.1"
1212
}
1313
}

app/aws-lsp-json-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"webpack": "webpack"
1212
},
1313
"dependencies": {
14-
"@aws/language-server-runtimes": "^0.2.74",
14+
"@aws/language-server-runtimes": "^0.2.76",
1515
"@aws/lsp-json": "*"
1616
},
1717
"devDependencies": {

app/aws-lsp-notification-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"compile": "tsc --build"
88
},
99
"dependencies": {
10-
"@aws/language-server-runtimes": "^0.2.74",
10+
"@aws/language-server-runtimes": "^0.2.76",
1111
"@aws/lsp-notification": "^0.0.1"
1212
}
1313
}

app/aws-lsp-yaml-json-webworker/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"serve:webpack": "NODE_ENV=development webpack serve"
1212
},
1313
"dependencies": {
14-
"@aws/language-server-runtimes": "^0.2.74",
14+
"@aws/language-server-runtimes": "^0.2.76",
1515
"@aws/lsp-json": "*",
1616
"@aws/lsp-yaml": "*"
1717
},

app/aws-lsp-yaml-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"webpack": "webpack"
1212
},
1313
"dependencies": {
14-
"@aws/language-server-runtimes": "^0.2.74",
14+
"@aws/language-server-runtimes": "^0.2.76",
1515
"@aws/lsp-yaml": "*"
1616
},
1717
"devDependencies": {

app/hello-world-lsp-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"dependencies": {
1717
"@aws/hello-world-lsp": "^0.0.1",
18-
"@aws/language-server-runtimes": "^0.2.74"
18+
"@aws/language-server-runtimes": "^0.2.76"
1919
},
2020
"devDependencies": {
2121
"@types/chai": "^4.3.5",

chat-client/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
},
2323
"dependencies": {
2424
"@aws/chat-client-ui-types": "^0.1.28",
25-
"@aws/language-server-runtimes-types": "^0.1.23",
26-
"@aws/mynah-ui": "^4.31.0-beta.6"
25+
"@aws/language-server-runtimes-types": "^0.1.25",
26+
"@aws/mynah-ui": "^4.31.0-beta.7"
2727
},
2828
"devDependencies": {
2929
"@types/jsdom": "^21.1.6",

chat-client/src/client/chat.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ describe('Chat', () => {
229229
assert.calledOnceWithExactly(updateStoreStub, tabId, {
230230
loadingChat: false,
231231
promptInputDisabledState: false,
232+
cancelButtonWhenLoading: true,
232233
})
233234
})
234235

chat-client/src/client/mynahUi.test.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ describe('MynahUI', () => {
9898
assert.notCalled(onQuickActionSpy)
9999
assert.calledWith(onChatPromptSpy, { prompt, tabId, context: undefined })
100100
assert.calledWith(addChatItemSpy, tabId, { type: ChatItemType.PROMPT, body: prompt.escapedPrompt })
101-
assert.calledWith(updateStoreSpy, tabId, { loadingChat: true, promptInputDisabledState: false })
101+
assert.calledWith(updateStoreSpy, tabId, {
102+
loadingChat: true,
103+
promptInputDisabledState: false,
104+
cancelButtonWhenLoading: true,
105+
})
102106
assert.calledWith(addChatItemSpy, tabId, { type: ChatItemType.ANSWER_STREAM })
103107
})
104108

@@ -127,7 +131,11 @@ describe('MynahUI', () => {
127131
tabId,
128132
})
129133
assert.calledOnce(updateStoreSpy)
130-
assert.calledWith(updateStoreSpy, tabId, { loadingChat: true, promptInputDisabledState: false })
134+
assert.calledWith(updateStoreSpy, tabId, {
135+
loadingChat: true,
136+
promptInputDisabledState: false,
137+
cancelButtonWhenLoading: true,
138+
})
131139
})
132140
})
133141

chat-client/src/client/mynahUi.ts

+18-3
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export const handleChatPrompt = (
125125
// Set UI to loading state
126126
mynahUi.updateStore(tabId, {
127127
loadingChat: true,
128+
cancelButtonWhenLoading: true,
128129
promptInputDisabledState: false,
129130
})
130131

@@ -202,8 +203,8 @@ export const createMynahUi = (
202203
messager.onUiReady()
203204
messager.onTabAdd(initialTabId)
204205
},
205-
onFileClick: (tabId, filePath, deleted, messageId, eventId) => {
206-
messager.onFileClick({ tabId, filePath, messageId })
206+
onFileClick: (tabId, filePath, deleted, messageId, eventId, fileDetails) => {
207+
messager.onFileClick({ tabId, filePath, messageId, fullPath: fileDetails?.data?.['fullPath'] })
207208
},
208209
onTabAdd: (tabId: string) => {
209210
const defaultTabBarData = tabFactory.getDefaultTabData()
@@ -428,6 +429,13 @@ export const createMynahUi = (
428429
}
429430
},
430431
onStopChatResponse: tabId => {
432+
const store = mynahUi.getTabData(tabId)?.getStore() || {}
433+
const chatItems = store.chatItems || []
434+
const updatedItems = chatItems.map(item => ({
435+
...item,
436+
type: item.type === ChatItemType.ANSWER_STREAM ? ChatItemType.ANSWER : item.type,
437+
}))
438+
mynahUi.updateStore(tabId, { loadingChat: false, cancelButtonWhenLoading: true, chatItems: updatedItems })
431439
messager.onStopChatResponse(tabId)
432440
},
433441
}
@@ -513,6 +521,9 @@ export const createMynahUi = (
513521
.join(', ') || '',
514522
description: filePath,
515523
clickable: true,
524+
data: {
525+
fullPath: fileDetails.fullPath || '',
526+
},
516527
},
517528
])
518529
),
@@ -535,6 +546,7 @@ export const createMynahUi = (
535546
if (chatResult.additionalMessages?.length) {
536547
mynahUi.updateStore(tabId, {
537548
loadingChat: true,
549+
cancelButtonWhenLoading: true,
538550
})
539551
chatResult.additionalMessages.forEach(am => {
540552
const chatItem: ChatItem = {
@@ -621,6 +633,7 @@ export const createMynahUi = (
621633

622634
mynahUi.updateStore(tabId, {
623635
loadingChat: false,
636+
cancelButtonWhenLoading: true,
624637
promptInputDisabledState: false,
625638
})
626639
}
@@ -629,6 +642,7 @@ export const createMynahUi = (
629642
const isChatLoading = params.state?.inProgress
630643
mynahUi.updateStore(params.tabId, {
631644
loadingChat: isChatLoading,
645+
cancelButtonWhenLoading: true,
632646
})
633647
if (params.data?.messages.length) {
634648
const { tabId } = params
@@ -735,6 +749,7 @@ ${params.message}`,
735749

736750
mynahUi.updateStore(tabId, {
737751
loadingChat: false,
752+
cancelButtonWhenLoading: true,
738753
promptInputDisabledState: false,
739754
})
740755

@@ -885,7 +900,7 @@ const uiComponentsTexts = {
885900
save: 'Save',
886901
cancel: 'Cancel',
887902
submit: 'Submit',
888-
stopGenerating: 'Stop generating',
903+
stopGenerating: 'Stop',
889904
copyToClipboard: 'Copied to clipboard',
890905
noMoreTabsTooltip: 'You can only open ten conversation tabs at a time.',
891906
codeSuggestionWithReferenceTitle: 'Some suggestions contain code with references.',

client/vscode/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
"@aws-sdk/credential-providers": "^3.731.1",
342342
"@aws-sdk/types": "^3.734.0",
343343
"@aws/chat-client-ui-types": "^0.1.28",
344-
"@aws/language-server-runtimes": "^0.2.74",
344+
"@aws/language-server-runtimes": "^0.2.76",
345345
"@types/uuid": "^9.0.8",
346346
"@types/vscode": "^1.98.0",
347347
"jose": "^5.2.4",

client/vscode/src/chatActivation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import {
4444
} from 'vscode-languageclient/node'
4545
import * as jose from 'jose'
4646
import * as vscode from 'vscode'
47-
import * as fs from 'fs'
4847

4948
export function registerChat(languageClient: LanguageClient, extensionUri: Uri, encryptionKey?: Buffer) {
5049
const webviewInitialized: Promise<Webview> = new Promise(resolveWebview => {
@@ -189,6 +188,7 @@ export function registerChat(languageClient: LanguageClient, extensionUri: Uri,
189188
default:
190189
if (isServerEvent(message.command))
191190
languageClient.sendNotification(message.command, message.params)
191+
else languageClient.info(`[VSCode Client] Unhandled command: ${message.command}`)
192192
break
193193
}
194194
}, undefined)

0 commit comments

Comments
 (0)