File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/amazonq/src/lsp/chat Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -683,7 +683,18 @@ export function registerMessageListeners(
683683 )
684684
685685 languageClient . onNotification ( openFileDiffNotificationType . method , async ( params : OpenFileDiffParams ) => {
686- const currentFileUri = vscode . Uri . parse ( params . originalFileUri )
686+ // Handle both file:// URIs and raw file paths, ensuring proper Windows path handling
687+ let currentFileUri : vscode . Uri
688+
689+ // Check if it's already a proper file:// URI
690+ if ( params . originalFileUri . startsWith ( 'file://' ) ) {
691+ currentFileUri = vscode . Uri . parse ( params . originalFileUri )
692+ } else {
693+ // Decode URL-encoded characters and treat as file path
694+ const decodedPath = decodeURIComponent ( params . originalFileUri )
695+ currentFileUri = vscode . Uri . file ( decodedPath )
696+ }
697+
687698 const originalContent = params . originalFileContent ?? ''
688699 const fileName = path . basename ( currentFileUri . fsPath )
689700
You can’t perform that action at this time.
0 commit comments