From 2e44cf25cbddb826a8aadfb09955309f958a8a35 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 09:22:00 +0100 Subject: [PATCH 1/4] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250314.1 (#77623) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 10.0.616304 -> To Version 10.0.616401 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 64e0e49379fd..2465d1a6dc52 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ <SourceBuild RepoName="source-build-externals" ManagedOnly="true" /> </Dependency> <!-- Intermediate is necessary for source build. --> - <Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.616304"> + <Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.616401"> <Uri>https://github.com/dotnet/source-build-reference-packages</Uri> - <Sha>cac4d021768f34079c30570518ece6af317cbab8</Sha> + <Sha>c3d4c372a15c2de79a2f26fe2b6b3644996d8550</Sha> <SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" /> </Dependency> <Dependency Name="System.CommandLine" Version="2.0.0-beta4.24528.1"> From 878db64fd6db1fcf95dbcd80f8b4e8e98e8f4f6d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 09:21:23 +0000 Subject: [PATCH 2/4] Update dependencies from https://github.com/dotnet/arcade build 20250314.2 (#77624) Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.XliffTasks From Version 9.0.0-beta.25161.4 -> To Version 9.0.0-beta.25164.2 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> --- eng/Version.Details.xml | 16 ++++++++-------- eng/common/tools.ps1 | 4 ++-- eng/common/tools.sh | 4 ++-- global.json | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2465d1a6dc52..d86c5d196dca 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -122,19 +122,19 @@ </Dependency> </ProductDependencies> <ToolsetDependencies> - <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25161.4"> + <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25164.2"> <Uri>https://github.com/dotnet/arcade</Uri> - <Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha> + <Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha> </Dependency> <!-- Intermediate is necessary for source build. --> - <Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25161.4"> + <Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25164.2"> <Uri>https://github.com/dotnet/arcade</Uri> - <Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha> + <Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha> <SourceBuild RepoName="arcade" ManagedOnly="true" /> </Dependency> - <Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.25161.4"> + <Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.25164.2"> <Uri>https://github.com/dotnet/arcade</Uri> - <Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha> + <Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha> </Dependency> <Dependency Name="Microsoft.DiaSymReader" Version="2.0.0"> <Uri>https://github.com/dotnet/symreader</Uri> @@ -150,9 +150,9 @@ <Uri>https://github.com/dotnet/roslyn</Uri> <Sha>5d10d428050c0d6afef30a072c4ae68776621877</Sha> </Dependency> - <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.25161.4"> + <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.25164.2"> <Uri>https://github.com/dotnet/arcade</Uri> - <Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha> + <Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha> </Dependency> <Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23468.1"> <Uri>https://github.com/dotnet/roslyn-analyzers</Uri> diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index a46b6deb7598..22b49e09d09b 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -42,7 +42,7 @@ [bool]$useInstalledDotNetCli = if (Test-Path variable:useInstalledDotNetCli) { $useInstalledDotNetCli } else { $true } # Enable repos to use a particular version of the on-line dotnet-install scripts. -# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1 +# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.ps1 [string]$dotnetInstallScriptVersion = if (Test-Path variable:dotnetInstallScriptVersion) { $dotnetInstallScriptVersion } else { 'v1' } # True to use global NuGet cache instead of restoring packages to repository-local directory. @@ -262,7 +262,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) { if (!(Test-Path $installScript)) { Create-Directory $dotnetRoot $ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit - $uri = "https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1" + $uri = "https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1" Retry({ Write-Host "GET $uri" diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 1159726a10fd..01b09b65796c 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -54,7 +54,7 @@ warn_as_error=${warn_as_error:-true} use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} # Enable repos to use a particular version of the on-line dotnet-install scripts. -# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh +# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} # True to use global NuGet cache instead of restoring packages to repository-local directory. @@ -295,7 +295,7 @@ function with_retries { function GetDotNetInstallScript { local root=$1 local install_script="$root/dotnet-install.sh" - local install_script_url="https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh" + local install_script_url="https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh" if [[ ! -a "$install_script" ]]; then mkdir -p "$root" diff --git a/global.json b/global.json index 5f60b28dd665..b094e3f86ce6 100644 --- a/global.json +++ b/global.json @@ -11,8 +11,8 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25161.4", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25161.4", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25164.2", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25164.2", "Microsoft.Build.Traversal": "3.4.0" } } From 3e4345f299dff0b6d26a02f42b3bad558d0bf93b Mon Sep 17 00:00:00 2001 From: Maryam Ariyan <maariyan@microsoft.com> Date: Mon, 17 Mar 2025 11:09:12 -0700 Subject: [PATCH 3/4] Correct how we pick up options for `ICopilotOptionsService` (#77620) * Corrections to how we pick up roslyn options settings * Cleanup * Set default for Implement with Copilot to be false * update for copilot.general.editor.enableGenerateDocumentationComment --- ...CSharpVisualStudioCopilotOptionsService.cs | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/VisualStudio/CSharp/Impl/Options/CSharpVisualStudioCopilotOptionsService.cs b/src/VisualStudio/CSharp/Impl/Options/CSharpVisualStudioCopilotOptionsService.cs index 067ff4a9896e..a9eab90ec968 100644 --- a/src/VisualStudio/CSharp/Impl/Options/CSharpVisualStudioCopilotOptionsService.cs +++ b/src/VisualStudio/CSharp/Impl/Options/CSharpVisualStudioCopilotOptionsService.cs @@ -4,15 +4,14 @@ using System; using System.Composition; -using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Copilot; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.Internal.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.Settings; using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Utilities.UnifiedSettings; namespace Microsoft.VisualStudio.LanguageServices.CSharp.Options; @@ -40,14 +39,12 @@ internal sealed class CSharpVisualStudioCopilotOptionsService : ICopilotOptionsS /// </summary> private const string GitHubAccountStatusIsCopilotEntitled = "3DE3FA6E-91B2-46C1-9E9E-DD04975BB890"; - private const string CopilotOptionNamePrefix = "Microsoft.VisualStudio.Conversations"; - // Default value must reflect their default values in ConversationsOptions in Copilot repo. - private readonly CopilotOption _copilotCodeAnalysisOption = new("EnableCSharpCodeAnalysis", false); - private readonly CopilotOption _copilotRefineOption = new("EnableCSharpRefineQuickActionSuggestion", false); - private readonly CopilotOption _copilotOnTheFlyDocsOption = new("EnableOnTheFlyDocs", true); - private readonly CopilotOption _copilotGenerateDocumentationCommentOption = new("EnableCSharpGenerateDocumentationComment", true); - private readonly CopilotOption _copilotGenerateMethodImplementationOption = new("EnableCSharpGenerateMethodImplementation", true); + private readonly CopilotOption _copilotCodeAnalysisOption = new("copilot.featureFlags.editor.enableCSharpCodeAnalysis", false); + private readonly CopilotOption _copilotRefineOption = new("copilot.featureFlags.editor.enableCSharpRefineQuickActionSuggestion", false); + private readonly CopilotOption _copilotOnTheFlyDocsOption = new("copilot.general.editor.enableOnTheFlyDocs", true); + private readonly CopilotOption _copilotGenerateDocumentationCommentOption = new("copilot.general.editor.enableGenerateDocumentationComment", true); + private readonly CopilotOption _copilotGenerateMethodImplementationOption = new("copilot.featureFlags.editor.enableCSharpGenerateMethodImplementation", false); private static readonly UIContext s_copilotHasLoadedUIContext = UIContext.FromUIContextGuid(new Guid(CopilotHasLoadedGuid)); private static readonly UIContext s_gitHubAccountStatusDeterminedContext = UIContext.FromUIContextGuid(new Guid(GitHubAccountStatusDetermined)); @@ -55,6 +52,7 @@ internal sealed class CSharpVisualStudioCopilotOptionsService : ICopilotOptionsS private static readonly UIContext s_gitHubAccountStatusSignedInUIContext = UIContext.FromUIContextGuid(new Guid(GitHubAccountStatusSignedIn)); private readonly Task<ISettingsManager> _settingsManagerTask; + private ISettingsReader? _settingsReader; /// <summary> /// Determines if Copilot is active and the user is signed in and entitled to use Copilot. @@ -68,7 +66,7 @@ private static bool IsGithubCopilotLoadedAndSignedIn [method: ImportingConstructor] [method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public CSharpVisualStudioCopilotOptionsService( - IVsService<SVsSettingsPersistenceManager, ISettingsManager> settingsManagerService, + IVsService<SVsUnifiedSettingsManager, ISettingsManager> settingsManagerService, IThreadingContext threadingContext) { _settingsManagerTask = settingsManagerService.GetValueAsync(threadingContext.DisposalToken); @@ -79,11 +77,23 @@ private async Task<bool> IsCopilotOptionEnabledAsync(CopilotOption option) if (!IsGithubCopilotLoadedAndSignedIn) return false; - var settingManager = await _settingsManagerTask.ConfigureAwait(false); - // The bool setting is persisted as 0=None, 1=True, 2=False, so it needs to be retrieved as an int. - // If isEnabled is 0 or the value is not persisted, we should return the default value for the option. - var isEnabled = settingManager.GetValueOrDefault($"{CopilotOptionNamePrefix}.{option.Name}", 0); - return isEnabled == 1 || (isEnabled == 0 && option.DefaultValue); + if (_settingsReader == null) + { + var settingsManager = await _settingsManagerTask.ConfigureAwait(false); + _settingsReader = settingsManager.GetReader(); + } + + try + { + if (_settingsReader.GetValue<bool>(option.Name) is { Outcome: SettingRetrievalOutcome.Success } setting) + return setting.Value; + + return option.DefaultValue; + } + catch + { + return option.DefaultValue; + } } public Task<bool> IsCodeAnalysisOptionEnabledAsync() From 85d110d5e8a3afef2d9e42560cb3be4890955416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Matou=C5=A1ek?= <tmat@users.noreply.github.com> Date: Mon, 17 Mar 2025 13:39:16 -0700 Subject: [PATCH 4/4] Add feature flag controlling Copilot prompt in Semantic Search (#77562) --- .../Impl/SemanticSearch/SemanticSearchToolWindowImpl.cs | 5 +++++ .../Core/Def/Options/VisualStudioOptionStorage.cs | 1 + .../Core/Def/SemanticSearch/SemanticSearchFeatureFlag.cs | 1 + 3 files changed, 7 insertions(+) diff --git a/src/VisualStudio/CSharp/Impl/SemanticSearch/SemanticSearchToolWindowImpl.cs b/src/VisualStudio/CSharp/Impl/SemanticSearch/SemanticSearchToolWindowImpl.cs index 23fc22863b3e..530a695cbbcb 100644 --- a/src/VisualStudio/CSharp/Impl/SemanticSearch/SemanticSearchToolWindowImpl.cs +++ b/src/VisualStudio/CSharp/Impl/SemanticSearch/SemanticSearchToolWindowImpl.cs @@ -198,6 +198,11 @@ public async Task<FrameworkElement> InitializeAsync(CancellationToken cancellati return null; } + if (!globalOptions.GetOption(SemanticSearchFeatureFlag.PromptEnabled)) + { + return null; + } + var outerGrid = new Grid() { Background = (Brush)Application.Current.FindResource(CommonControlsColors.TextBoxBackgroundBrushKey), diff --git a/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs b/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs index b838cbd7a7fb..3bf4c29fe147 100644 --- a/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs +++ b/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs @@ -372,6 +372,7 @@ public bool TryFetch(LocalUserRegistryOptionPersister persister, OptionKey2 opti {"dotnet_unsupported_report_invalid_json_patterns", new RoamingProfileStorage("TextEditor.%LANGUAGE%.Specific.ReportInvalidJsonPatterns")}, {"visual_studio_enable_key_binding_reset", new FeatureFlagStorage("Roslyn.KeybindingResetEnabled")}, {"visual_studio_enable_semantic_search", new FeatureFlagStorage("Roslyn.SemanticSearchEnabled")}, + {"visual_studio_enable_semantic_search_prompt", new FeatureFlagStorage("Roslyn.ShowPromptInSemanticSearch")}, {"visual_studio_enable_copilot_rename_context", new FeatureFlagStorage("Roslyn.CopilotRenameGetContext")}, {"visual_studio_key_binding_needs_reset", new LocalUserProfileStorage(@"Roslyn\Internal\KeybindingsStatus", "NeedsReset")}, {"visual_studio_key_binding_reset_never_show_again", new LocalUserProfileStorage(@"Roslyn\Internal\KeybindingsStatus", "NeverShowAgain")}, diff --git a/src/VisualStudio/Core/Def/SemanticSearch/SemanticSearchFeatureFlag.cs b/src/VisualStudio/Core/Def/SemanticSearch/SemanticSearchFeatureFlag.cs index 4b5e4cadb7d7..caf12828d200 100644 --- a/src/VisualStudio/Core/Def/SemanticSearch/SemanticSearchFeatureFlag.cs +++ b/src/VisualStudio/Core/Def/SemanticSearch/SemanticSearchFeatureFlag.cs @@ -9,6 +9,7 @@ namespace Microsoft.VisualStudio.LanguageServices; internal static class SemanticSearchFeatureFlag { public static readonly Option2<bool> Enabled = new("visual_studio_enable_semantic_search", defaultValue: false); + public static readonly Option2<bool> PromptEnabled = new("visual_studio_enable_semantic_search_prompt", defaultValue: false); /// <summary> /// Context id that indicates that Semantic Search feature is enabled.