Skip to content

Commit 05586f9

Browse files
committed
fix logic
1 parent 463bf11 commit 05586f9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/core/src/amazonq/lsp/lspController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ export class LspController {
329329
getLogger().info(`LspController: Skipping building index. No projects found in workspace`)
330330
return
331331
}
332+
projPaths.sort()
332333
try {
333334
this._isIndexingInProgress = true
334335
const projRoot = projPaths[0]

packages/core/src/codewhispererChat/controllers/chat/controller.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,10 +917,12 @@ export class ChatController {
917917
if (contextCommands.length === 0) {
918918
return []
919919
}
920-
const workspaceFolder = vscode.workspace.workspaceFolders?.[0].uri?.fsPath
921-
if (!workspaceFolder) {
920+
let workspaceFolders = (vscode.workspace.workspaceFolders ?? []).map((folder) => folder.uri.fsPath)
921+
if (!workspaceFolders) {
922922
return []
923923
}
924+
workspaceFolders.sort()
925+
let workspaceFolder = workspaceFolders[0]
924926
for (const contextCommand of contextCommands) {
925927
let relativePath = path.relative(
926928
workspaceFolder,

0 commit comments

Comments
 (0)