@@ -72,43 +72,43 @@ export interface ProjectContext {
7272
7373export async function getProjectContext ( uri : vscode . Uri , context : { flags : Record < string , unknown > } , cancellationToken : vscode . CancellationToken , telemetryProperties : Record < string , string > , telemetryMetrics : Record < string , number > ) : Promise < ProjectContext | undefined > {
7474 try {
75- const projectContext = await checkDuration < ChatContextResult | undefined > ( async ( ) => await getClients ( ) ?. ActiveClient ?. getChatContext ( uri , cancellationToken ) ?? undefined ) ;
76- telemetryMetrics [ "projectContextDuration" ] = projectContext . duration ;
77- if ( ! projectContext . result ) {
75+ const chatContext = await checkDuration < ChatContextResult | undefined > ( async ( ) => await getClients ( ) ?. ActiveClient ?. getChatContext ( uri , cancellationToken ) ?? undefined ) ;
76+ telemetryMetrics [ "projectContextDuration" ] = chatContext . duration ;
77+ if ( ! chatContext . result ) {
7878 return undefined ;
7979 }
8080
81- const originalStandardVersion = projectContext . result . standardVersion ;
81+ const originalStandardVersion = chatContext . result . standardVersion ;
8282
83- formatChatContext ( projectContext . result ) ;
83+ formatChatContext ( chatContext . result ) ;
8484
8585 const result : ProjectContext = {
86- language : projectContext . result . language ,
87- standardVersion : projectContext . result . standardVersion ,
88- compiler : projectContext . result . compiler ,
89- targetPlatform : projectContext . result . targetPlatform ,
90- targetArchitecture : projectContext . result . targetArchitecture
86+ language : chatContext . result . language ,
87+ standardVersion : chatContext . result . standardVersion ,
88+ compiler : chatContext . result . compiler ,
89+ targetPlatform : chatContext . result . targetPlatform ,
90+ targetArchitecture : chatContext . result . targetArchitecture
9191 } ;
9292
93- if ( projectContext . result . language ) {
94- telemetryProperties [ "language" ] = projectContext . result . language ;
93+ if ( result . language ) {
94+ telemetryProperties [ "language" ] = result . language ;
9595 }
96- if ( projectContext . result . compiler ) {
97- telemetryProperties [ "compiler" ] = projectContext . result . compiler ;
96+ if ( result . compiler ) {
97+ telemetryProperties [ "compiler" ] = result . compiler ;
9898 }
99- if ( projectContext . result . standardVersion ) {
100- telemetryProperties [ "standardVersion" ] = projectContext . result . standardVersion ;
99+ if ( result . standardVersion ) {
100+ telemetryProperties [ "standardVersion" ] = result . standardVersion ;
101101 }
102102 else {
103103 if ( originalStandardVersion ) {
104104 telemetryProperties [ "originalStandardVersion" ] = originalStandardVersion ;
105105 }
106106 }
107- if ( projectContext . result . targetPlatform ) {
108- telemetryProperties [ "targetPlatform" ] = projectContext . result . targetPlatform ;
107+ if ( result . targetPlatform ) {
108+ telemetryProperties [ "targetPlatform" ] = result . targetPlatform ;
109109 }
110- if ( projectContext . result . targetArchitecture ) {
111- telemetryProperties [ "targetArchitecture" ] = projectContext . result . targetArchitecture ;
110+ if ( result . targetArchitecture ) {
111+ telemetryProperties [ "targetArchitecture" ] = result . targetArchitecture ;
112112 }
113113
114114 return result ;
0 commit comments