File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/core/src/codewhispererChat/controllers/chat Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,20 @@ export class ChatController {
305305 }
306306
307307 private processResponseBodyLinkClick ( click : ResponseBodyLinkClickMessage ) {
308- this . openLinkInExternalBrowser ( click )
308+ const uri = vscode . Uri . parse ( click . link )
309+ if ( uri . scheme === 'file' ) {
310+ void this . openFile ( uri . fsPath )
311+ } else {
312+ this . openLinkInExternalBrowser ( click )
313+ }
314+ }
315+
316+ private async openFile ( absolutePath : string ) {
317+ const fileExists = await fs . existsFile ( absolutePath )
318+ if ( fileExists ) {
319+ const document = await vscode . workspace . openTextDocument ( absolutePath )
320+ await vscode . window . showTextDocument ( document )
321+ }
309322 }
310323
311324 private processSourceLinkClick ( click : SourceLinkClickMessage ) {
You can’t perform that action at this time.
0 commit comments