From 0622badeb4c8ac3bf22b240f9db565c1ba319664 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Wed, 1 Oct 2025 19:53:53 -0700 Subject: [PATCH 1/4] Add new telemetry fields --- src/shared/projectConfiguration.ts | 6 ++++++ .../omnisharpUnitTests/logging/telemetryObserver.test.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/shared/projectConfiguration.ts b/src/shared/projectConfiguration.ts index 8e5bb01335..227f15d414 100644 --- a/src/shared/projectConfiguration.ts +++ b/src/shared/projectConfiguration.ts @@ -19,6 +19,9 @@ export interface ProjectConfigurationMessage { FileExtensions: string[]; FileCounts: number[]; SdkStyleProject: boolean; + HasSolutionFile: boolean; + IsFileBasedProgram: boolean; + IsMiscellaneousFile: boolean; } export function reportProjectConfigurationEvent( @@ -46,6 +49,9 @@ export function reportProjectConfigurationEvent( telemetryProps['FileCounts'] = projectConfig.FileCounts?.join('|') ?? ''; telemetryProps['NetSdkVersion'] = dotnetInfo?.Version ?? ''; telemetryProps['sdkStyleProject'] = projectConfig.SdkStyleProject.toString(); + telemetryProps['HasSolutionFile'] = projectConfig.HasSolutionFile.toString(); + telemetryProps['IsFileBasedProgram'] = projectConfig.IsFileBasedProgram.toString(); + telemetryProps['IsMiscellaneousFile'] = projectConfig.IsMiscellaneousFile.toString(); if (useModernNet) { telemetryProps['useModernNet'] = useModernNet.toString(); diff --git a/test/omnisharp/omnisharpUnitTests/logging/telemetryObserver.test.ts b/test/omnisharp/omnisharpUnitTests/logging/telemetryObserver.test.ts index 0110c87f9a..57417a4658 100644 --- a/test/omnisharp/omnisharpUnitTests/logging/telemetryObserver.test.ts +++ b/test/omnisharp/omnisharpUnitTests/logging/telemetryObserver.test.ts @@ -100,6 +100,9 @@ describe('TelemetryReporterObserver', () => { FileExtensions: fileExtensions, FileCounts: fileCounts, SdkStyleProject: sdkStyleProject, + HasSolutionFile: true, + IsFileBasedProgram: true, + IsMiscellaneousFile: true }); await observer.post(event); @@ -114,6 +117,9 @@ describe('TelemetryReporterObserver', () => { expect(property['FileCounts']).toEqual('7|3'); expect(property['useModernNet']).toEqual('true'); expect(property['sdkStyleProject']).toEqual('true'); + expect(property['HasSolutionFile']).toEqual('true'); + expect(property['IsFileBasedProgram']).toEqual('true'); + expect(property['IsMiscellaneousFile']).toEqual('true'); }); [ From f6ad10f9e979d3fe992b7e650137a58843bff728 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Mon, 6 Oct 2025 11:24:33 -0700 Subject: [PATCH 2/4] Bump roslyn. Make new props optional. --- CHANGELOG.md | 17 +++++++++++++++++ package.json | 2 +- src/shared/projectConfiguration.ts | 21 +++++++++++++++------ 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddebba49a1..ef0ce14716 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,23 @@ - Diagnostics related feature requests and improvements [#5951](https://github.com/dotnet/vscode-csharp/issues/5951) - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) +# Next +- [Improve error recovery when object initializer uses ':' instead of '='](https://github.com/dotnet/roslyn/pull/80553) +- [Support `field` keyword in EE.](https://github.com/dotnet/roslyn/pull/80515) +- [Log a debug message for ContentModified exceptions.](https://github.com/dotnet/roslyn/pull/80549) +- [Update proposal adjuster to acquire feature flags from VS](https://github.com/dotnet/roslyn/pull/80541) +- [Add telemetry indicating when file-based programs are used](https://github.com/dotnet/roslyn/pull/80538) +- [Fix thread safety issue in BuildServerConnection.TryCreateServer environment variable handling](https://github.com/dotnet/roslyn/pull/80498) +- [Extensions: refine tracking of used imports](https://github.com/dotnet/roslyn/pull/80485) +- [Disambiguate extension methods in "ambiguous call" error message when they have the same name but are from different assemblies](https://github.com/dotnet/roslyn/pull/80453) +- [Block file-local EmbeddedAttribute definitions.](https://github.com/dotnet/roslyn/pull/80501) +- [Extension block members do not have `this` parameter](https://github.com/dotnet/roslyn/pull/80457) +- [Handle some scenarios where attributes applied in local functions or lambdas within extension blocks were missing in metadata](https://github.com/dotnet/roslyn/pull/80464) +- [Unset other DOTNET_ROOT env vars when launching apphosts](https://github.com/dotnet/roslyn/pull/80492) +- [Add friendlier error message on an explicit implementation when the return type is wrong](https://github.com/dotnet/roslyn/pull/80376) +- [Extensions: add Name property on embedded ExtensionMarkerAttribute](https://github.com/dotnet/roslyn/pull/80456) +- [Avoid implicit null checks while narrowing type for `or` patterns](https://github.com/dotnet/roslyn/pull/80348) + # 2.94.x * Fix update changelog script (PR: [#8671](https://github.com/dotnet/vscode-csharp/pull/8671)) * Update RoslynCopilot url to 18.0.797-alpha (PR: [#8652](https://github.com/OmniSharp/omnisharp-vscode/pull/8652)) diff --git a/package.json b/package.json index c54eaf1a96..501e0d28c6 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "workspace" ], "defaults": { - "roslyn": "5.1.0-1.25475.3", + "roslyn": "5.1.0-1.25506.3", "omniSharp": "1.39.14", "razor": "10.0.0-preview.25472.6", "razorOmnisharp": "7.0.0-preview.23363.1", diff --git a/src/shared/projectConfiguration.ts b/src/shared/projectConfiguration.ts index 227f15d414..e774cc24bb 100644 --- a/src/shared/projectConfiguration.ts +++ b/src/shared/projectConfiguration.ts @@ -19,9 +19,9 @@ export interface ProjectConfigurationMessage { FileExtensions: string[]; FileCounts: number[]; SdkStyleProject: boolean; - HasSolutionFile: boolean; - IsFileBasedProgram: boolean; - IsMiscellaneousFile: boolean; + HasSolutionFile?: boolean; + IsFileBasedProgram?: boolean; + IsMiscellaneousFile?: boolean; } export function reportProjectConfigurationEvent( @@ -49,9 +49,18 @@ export function reportProjectConfigurationEvent( telemetryProps['FileCounts'] = projectConfig.FileCounts?.join('|') ?? ''; telemetryProps['NetSdkVersion'] = dotnetInfo?.Version ?? ''; telemetryProps['sdkStyleProject'] = projectConfig.SdkStyleProject.toString(); - telemetryProps['HasSolutionFile'] = projectConfig.HasSolutionFile.toString(); - telemetryProps['IsFileBasedProgram'] = projectConfig.IsFileBasedProgram.toString(); - telemetryProps['IsMiscellaneousFile'] = projectConfig.IsMiscellaneousFile.toString(); + + if (projectConfig.HasSolutionFile != null) { + telemetryProps['HasSolutionFile'] = projectConfig.HasSolutionFile.toString(); + } + + if (projectConfig.IsFileBasedProgram != null) { + telemetryProps['IsFileBasedProgram'] = projectConfig.IsFileBasedProgram.toString(); + } + + if (projectConfig.IsMiscellaneousFile != null) { + telemetryProps['IsMiscellaneousFile'] = projectConfig.IsMiscellaneousFile.toString(); + } if (useModernNet) { telemetryProps['useModernNet'] = useModernNet.toString(); From ca5ce77074427153433cedbd2f97829b4f2da56f Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Mon, 6 Oct 2025 11:35:41 -0700 Subject: [PATCH 3/4] Fix changelog --- CHANGELOG.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef0ce14716..91ccbd288f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,23 +3,6 @@ - Diagnostics related feature requests and improvements [#5951](https://github.com/dotnet/vscode-csharp/issues/5951) - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) -# Next -- [Improve error recovery when object initializer uses ':' instead of '='](https://github.com/dotnet/roslyn/pull/80553) -- [Support `field` keyword in EE.](https://github.com/dotnet/roslyn/pull/80515) -- [Log a debug message for ContentModified exceptions.](https://github.com/dotnet/roslyn/pull/80549) -- [Update proposal adjuster to acquire feature flags from VS](https://github.com/dotnet/roslyn/pull/80541) -- [Add telemetry indicating when file-based programs are used](https://github.com/dotnet/roslyn/pull/80538) -- [Fix thread safety issue in BuildServerConnection.TryCreateServer environment variable handling](https://github.com/dotnet/roslyn/pull/80498) -- [Extensions: refine tracking of used imports](https://github.com/dotnet/roslyn/pull/80485) -- [Disambiguate extension methods in "ambiguous call" error message when they have the same name but are from different assemblies](https://github.com/dotnet/roslyn/pull/80453) -- [Block file-local EmbeddedAttribute definitions.](https://github.com/dotnet/roslyn/pull/80501) -- [Extension block members do not have `this` parameter](https://github.com/dotnet/roslyn/pull/80457) -- [Handle some scenarios where attributes applied in local functions or lambdas within extension blocks were missing in metadata](https://github.com/dotnet/roslyn/pull/80464) -- [Unset other DOTNET_ROOT env vars when launching apphosts](https://github.com/dotnet/roslyn/pull/80492) -- [Add friendlier error message on an explicit implementation when the return type is wrong](https://github.com/dotnet/roslyn/pull/80376) -- [Extensions: add Name property on embedded ExtensionMarkerAttribute](https://github.com/dotnet/roslyn/pull/80456) -- [Avoid implicit null checks while narrowing type for `or` patterns](https://github.com/dotnet/roslyn/pull/80348) - # 2.94.x * Fix update changelog script (PR: [#8671](https://github.com/dotnet/vscode-csharp/pull/8671)) * Update RoslynCopilot url to 18.0.797-alpha (PR: [#8652](https://github.com/OmniSharp/omnisharp-vscode/pull/8652)) @@ -38,16 +21,33 @@ * Bump tar-fs from 2.1.3 to 2.1.4 (PR: [#8661](https://github.com/dotnet/vscode-csharp/pull/8661)) * Add copilot setup steps (PR: [#8655](https://github.com/dotnet/vscode-csharp/pull/8655)) * Update pipeline and packaging excludes (PR: [#8654](https://github.com/dotnet/vscode-csharp/pull/8654)) +* Add new telemetry fields (PR: [#8673](https://github.com/dotnet/vscode-csharp/pull/8673)) +* Bump Roslyn to 5.1.0-1.25506.3 (PR: [#8673](https://github.com/dotnet/vscode-csharp/pull/8673)) + * Improve error recovery when object initializer uses ':' instead of '=' (PR: [#80553](https://github.com/dotnet/roslyn/pull/80553)) + * Support `field` keyword in EE. (PR: [#80515](https://github.com/dotnet/roslyn/pull/80515)) + * Log a debug message for ContentModified exceptions. (PR: [#80549](https://github.com/dotnet/roslyn/pull/80549)) + * Update proposal adjuster to acquire feature flags from VS (PR: [#80541](https://github.com/dotnet/roslyn/pull/80541)) + * Add telemetry indicating when file-based programs are used (PR: [#80538](https://github.com/dotnet/roslyn/pull/80538)) + * Fix thread safety issue in BuildServerConnection.TryCreateServer environment variable handling (PR: [#80498](https://github.com/dotnet/roslyn/pull/80498)) + * Extensions: refine tracking of used imports (PR: [#80485](https://github.com/dotnet/roslyn/pull/80485)) + * Disambiguate extension methods in "ambiguous call" error message when they have the same name but are from different assemblies (PR: [#80453](https://github.com/dotnet/roslyn/pull/80453)) + * Block file-local EmbeddedAttribute definitions. (PR: [#80501](https://github.com/dotnet/roslyn/pull/80501)) + * Extension block members do not have `this` parameter (PR: [#80457](https://github.com/dotnet/roslyn/pull/80457)) + * Handle some scenarios where attributes applied in local functions or lambdas within extension blocks were missing in metadata (PR: [#80464](https://github.com/dotnet/roslyn/pull/80464)) + * Unset other DOTNET_ROOT env vars when launching apphosts (PR: [#80492](https://github.com/dotnet/roslyn/pull/80492)) + * Add friendlier error message on an explicit implementation when the return type is wrong (PR: [#8037](https://github.com/dotnet/roslyn/pull/80376) + * Extensions: add Name property on embedded ExtensionMarkerAttribute (PR: [#80456](https://github.com/dotnet/roslyn/pull/80456)) + * Avoid implicit null checks while narrowing type for `or` patterns (PR: [#80348](https://github.com/dotnet/roslyn/pull/80348)) # 2.93.x * Bump Roslyn to 5.0.0-2.25472.11 (PR: [#8646](https://github.com/dotnet/vscode-csharp/pull/8646)) - * Fix handling edits in types nested in reloadable types(PR: [#80360](https://github.com/dotnet/roslyn/pull/80360)) - * Remove CS1998 warning entirely and remove dependent C# code fix providers(PR: [#80144](https://github.com/dotnet/roslyn/pull/80144)) - * Only restore based on assets file changes if the actual content changed(PR: [#80341](https://github.com/dotnet/roslyn/pull/80341)) + * Fix handling edits in types nested in reloadable types (PR: [#80360](https://github.com/dotnet/roslyn/pull/80360)) + * Remove CS1998 warning entirely and remove dependent C# code fix providers (PR: [#80144](https://github.com/dotnet/roslyn/pull/80144)) + * Only restore based on assets file changes if the actual content changed (PR: [#80341](https://github.com/dotnet/roslyn/pull/80341)) * Fix issue where build artifacts were added in source tree (PR: [#80324](https://github.com/dotnet/roslyn/pull/80324)) - * Allow clients to send range ending at the line after the last line in the document(PR: [#80310](https://github.com/dotnet/roslyn/pull/80310)) - * Don't show Razor diagnostics in Full Solution Analysis(PR: [#80296](https://github.com/dotnet/roslyn/pull/80296)) - * Log project context in which document was found(PR: [#80202](https://github.com/dotnet/roslyn/pull/80202)) + * Allow clients to send range ending at the line after the last line in the document (PR: [#80310](https://github.com/dotnet/roslyn/pull/80310)) + * Don't show Razor diagnostics in Full Solution Analysis (PR: [#80296](https://github.com/dotnet/roslyn/pull/80296)) + * Log project context in which document was found (PR: [#80202](https://github.com/dotnet/roslyn/pull/80202)) * Bump Razor to 10.0.0-preview.25472.6 (PR: [#8639](https://github.com/dotnet/vscode-csharp/pull/8639)) * Support view components in Go To Def (PR: [#12222](https://github.com/dotnet/razor/pull/12222)) * Redirect the older named assembly too (PR: [#12239](https://github.com/dotnet/razor/pull/12239)) From 525d0b0b466afc6c412deb49eee48d7b6ba34d62 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Mon, 6 Oct 2025 11:40:37 -0700 Subject: [PATCH 4/4] prettier --- .../omnisharpUnitTests/logging/telemetryObserver.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/omnisharp/omnisharpUnitTests/logging/telemetryObserver.test.ts b/test/omnisharp/omnisharpUnitTests/logging/telemetryObserver.test.ts index 57417a4658..26b4bf3728 100644 --- a/test/omnisharp/omnisharpUnitTests/logging/telemetryObserver.test.ts +++ b/test/omnisharp/omnisharpUnitTests/logging/telemetryObserver.test.ts @@ -102,7 +102,7 @@ describe('TelemetryReporterObserver', () => { SdkStyleProject: sdkStyleProject, HasSolutionFile: true, IsFileBasedProgram: true, - IsMiscellaneousFile: true + IsMiscellaneousFile: true, }); await observer.post(event);