File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -13,5 +13,5 @@ export interface CSharpDevKitExports {
13
13
components : Readonly < { [ key : string ] : string } > ;
14
14
hasServerProcessLoaded : ( ) => boolean ;
15
15
serverProcessLoaded : vscode . Event < void > ;
16
- writeCommonPropsAsync : ( context : vscode . ExtensionContext ) => Promise < string | undefined > ;
16
+ setupTelemetryEnvironmentAsync : ( env : NodeJS . ProcessEnv ) => Promise < string | undefined > ;
17
17
}
Original file line number Diff line number Diff line change @@ -409,6 +409,8 @@ export class RoslynLanguageServer {
409
409
410
410
const csharpDevkitArgs = await this . getCSharpDevkitExportArgs ( csharpDevkitExtension , options ) ;
411
411
args = args . concat ( csharpDevkitArgs ) ;
412
+
413
+ await this . setupDevKitEnvironment ( env , csharpDevkitExtension ) ;
412
414
} else {
413
415
// C# Dev Kit is not installed - continue C#-only activation.
414
416
_channel . appendLine ( 'Activating C# standalone...' ) ;
@@ -528,6 +530,21 @@ export class RoslynLanguageServer {
528
530
return csharpIntelliCodeArgs ;
529
531
}
530
532
533
+ private async setupDevKitEnvironment (
534
+ env : NodeJS . ProcessEnv ,
535
+ csharpDevkitExtension : vscode . Extension < CSharpDevKitExports >
536
+ ) : Promise < void > {
537
+ const exports : CSharpDevKitExports = await csharpDevkitExtension . activate ( ) ;
538
+
539
+ // setupTelemetryEnvironmentAsync was a later addition to devkit (not in preview 1)
540
+ // so it may not exist in whatever version of devkit the user has installed
541
+ if ( ! exports . setupTelemetryEnvironmentAsync ) {
542
+ return ;
543
+ }
544
+
545
+ await exports . setupTelemetryEnvironmentAsync ( env ) ;
546
+ }
547
+
531
548
private getLanguageServicesDevKitComponentPath ( csharpDevKitExports : CSharpDevKitExports ) : string {
532
549
return path . join (
533
550
csharpDevKitExports . components [ '@microsoft/visualstudio-languageservices-devkit' ] ,
You can’t perform that action at this time.
0 commit comments