File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/extension/agents/copilotcli/node Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,9 @@ export class CopilotCLIAgentManager extends Disposable {
8787 if ( ref . value instanceof ChatReferenceDiagnostic ) {
8888 // Handle diagnostic reference
8989 for ( const [ uri , diagnostics ] of ref . value . diagnostics ) {
90+ if ( uri . scheme !== 'file' ) {
91+ continue ;
92+ }
9093 for ( const diagnostic of diagnostics ) {
9194 const severityMap : { [ key : number ] : string } = {
9295 0 : 'error' ,
@@ -103,10 +106,12 @@ export class CopilotCLIAgentManager extends Disposable {
103106 }
104107 }
105108 } else {
106- const filePath = URI . isUri ( ref . value ) ? ref . value . fsPath : isLocation ( ref . value ) ? ref . value . uri . fsPath : undefined ;
107- if ( filePath ) {
108- files . push ( { path : filePath , name : ref . name || path . basename ( filePath ) } ) ;
109+ const uri = URI . isUri ( ref . value ) ? ref . value : isLocation ( ref . value ) ? ref . value . uri : undefined ;
110+ if ( ! uri || uri . scheme !== 'file' ) {
111+ return ;
109112 }
113+ const filePath = uri . fsPath ;
114+ files . push ( { path : filePath , name : ref . name || path . basename ( filePath ) } ) ;
110115 const valueText = URI . isUri ( ref . value ) ?
111116 ref . value . fsPath :
112117 isLocation ( ref . value ) ?
You can’t perform that action at this time.
0 commit comments