Skip to content

Commit fab073c

Browse files
authored
fix(amazonq): fix to normlize workspace paths in windows (aws#2306)
1 parent 84e2c8c commit fab073c

File tree

1 file changed

+12
-3
lines changed
  • server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/mcp

1 file changed

+12
-3
lines changed

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/mcp/mcpUtils.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,10 @@ export async function loadPersonaPermissions(
634634

635635
/** Given an array of workspace diretory, return each workspace persona config location */
636636
export function getWorkspacePersonaConfigPaths(wsUris: string[]): string[] {
637-
return wsUris.map(uri => path.join(uri, '.amazonq', 'personas', 'default.json'))
637+
return wsUris.map(uri => {
638+
const fsPath = normalizePathFromUri(uri)
639+
return path.join(fsPath, '.amazonq', 'personas', 'default.json')
640+
})
638641
}
639642

640643
/** Given a user's home directory, return the global persona config location */
@@ -644,7 +647,10 @@ export function getGlobalPersonaConfigPath(home: string): string {
644647

645648
/** Given an array of workspace diretory, return each workspace agent config location */
646649
export function getWorkspaceAgentConfigPaths(wsUris: string[]): string[] {
647-
return wsUris.map(uri => path.join(uri, '.amazonq', 'agents', 'default.json'))
650+
return wsUris.map(uri => {
651+
const fsPath = normalizePathFromUri(uri)
652+
return path.join(fsPath, '.amazonq', 'agents', 'default.json')
653+
})
648654
}
649655

650656
/** Given a user's home directory, return the global agent config location */
@@ -654,7 +660,10 @@ export function getGlobalAgentConfigPath(home: string): string {
654660

655661
/** Given an array of workspace diretory, return each workspace mcp config location */
656662
export function getWorkspaceMcpConfigPaths(wsUris: string[]): string[] {
657-
return wsUris.map(uri => path.join(uri, '.amazonq', 'mcp.json'))
663+
return wsUris.map(uri => {
664+
const fsPath = normalizePathFromUri(uri)
665+
return path.join(fsPath, '.amazonq', 'mcp.json')
666+
})
658667
}
659668

660669
/** Given a user's home directory, return the global mcp config location */

0 commit comments

Comments
 (0)