Skip to content

Commit 486ef41

Browse files
[automated] Merge branch 'main' => 'release/dev18.0' (#77644)
I detected changes in the main branch which have not been merged yet to release/dev18.0. I'm a robot and am configured to help you automatically keep release/dev18.0 up to date, so I've opened this PR. This PR merges commits made on main by the following committers: * tmat * maryamariyan * dotnet-maestro[bot] ## Instructions for merging from UI This PR will not be auto-merged. When pull request checks pass, complete this PR by creating a merge commit, *not* a squash or rebase commit. <img alt="merge button instructions" src="https://i.imgur.com/GepcNJV.png" width="300" /> If this repo does not allow creating merge commits from the GitHub UI, use command line instructions. ## Instructions for merging via command line Run these commands to merge this pull request from the command line. ``` sh git fetch git checkout main git pull --ff-only git checkout release/dev18.0 git pull --ff-only git merge --no-ff main # If there are merge conflicts, resolve them and then run git merge --continue to complete the merge # Pushing the changes to the PR branch will re-trigger PR validation. git push https://github.com/dotnet/roslyn HEAD:merge/main-to-release/dev18.0 ``` <details> <summary>or if you are using SSH</summary> ``` git push git@github.com:dotnet/roslyn HEAD:merge/main-to-release/dev18.0 ``` </details> After PR checks are complete push the branch ``` git push ``` ## Instructions for resolving conflicts :warning: If there are merge conflicts, you will need to resolve them manually before merging. You can do this [using GitHub][resolve-github] or using the [command line][resolve-cli]. [resolve-github]: https://help.github.com/articles/resolving-a-merge-conflict-on-github/ [resolve-cli]: https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/ ## Instructions for updating this pull request Contributors to this repo have permission update this pull request by pushing to the branch 'merge/main-to-release/dev18.0'. This can be done to resolve conflicts or make other changes to this pull request before it is merged. The provided examples assume that the remote is named 'origin'. If you have a different remote name, please replace 'origin' with the name of your remote. ``` git fetch git checkout -b merge/main-to-release/dev18.0 origin/release/dev18.0 git pull https://github.com/dotnet/roslyn merge/main-to-release/dev18.0 (make changes) git commit -m "Updated PR with my changes" git push https://github.com/dotnet/roslyn HEAD:merge/main-to-release/dev18.0 ``` <details> <summary>or if you are using SSH</summary> ``` git fetch git checkout -b merge/main-to-release/dev18.0 origin/release/dev18.0 git pull git@github.com:dotnet/roslyn merge/main-to-release/dev18.0 (make changes) git commit -m "Updated PR with my changes" git push git@github.com:dotnet/roslyn HEAD:merge/main-to-release/dev18.0 ``` </details> Contact .NET Core Engineering (dotnet/dnceng) if you have questions or issues. Also, if this PR was generated incorrectly, help us fix it. See https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.
2 parents 244f6dc + 85d110d commit 486ef41

File tree

8 files changed

+48
-31
lines changed

8 files changed

+48
-31
lines changed

eng/Version.Details.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
99
</Dependency>
1010
<!-- Intermediate is necessary for source build. -->
11-
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.616304">
11+
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.616401">
1212
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
13-
<Sha>cac4d021768f34079c30570518ece6af317cbab8</Sha>
13+
<Sha>c3d4c372a15c2de79a2f26fe2b6b3644996d8550</Sha>
1414
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
1515
</Dependency>
1616
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.24528.1">
@@ -122,19 +122,19 @@
122122
</Dependency>
123123
</ProductDependencies>
124124
<ToolsetDependencies>
125-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25161.4">
125+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25164.2">
126126
<Uri>https://github.com/dotnet/arcade</Uri>
127-
<Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha>
127+
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
128128
</Dependency>
129129
<!-- Intermediate is necessary for source build. -->
130-
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25161.4">
130+
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25164.2">
131131
<Uri>https://github.com/dotnet/arcade</Uri>
132-
<Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha>
132+
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
133133
<SourceBuild RepoName="arcade" ManagedOnly="true" />
134134
</Dependency>
135-
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.25161.4">
135+
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.25164.2">
136136
<Uri>https://github.com/dotnet/arcade</Uri>
137-
<Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha>
137+
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
138138
</Dependency>
139139
<Dependency Name="Microsoft.DiaSymReader" Version="2.0.0">
140140
<Uri>https://github.com/dotnet/symreader</Uri>
@@ -150,9 +150,9 @@
150150
<Uri>https://github.com/dotnet/roslyn</Uri>
151151
<Sha>5d10d428050c0d6afef30a072c4ae68776621877</Sha>
152152
</Dependency>
153-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.25161.4">
153+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.25164.2">
154154
<Uri>https://github.com/dotnet/arcade</Uri>
155-
<Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha>
155+
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
156156
</Dependency>
157157
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23468.1">
158158
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>

eng/common/tools.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
[bool]$useInstalledDotNetCli = if (Test-Path variable:useInstalledDotNetCli) { $useInstalledDotNetCli } else { $true }
4343

4444
# Enable repos to use a particular version of the on-line dotnet-install scripts.
45-
# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1
45+
# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.ps1
4646
[string]$dotnetInstallScriptVersion = if (Test-Path variable:dotnetInstallScriptVersion) { $dotnetInstallScriptVersion } else { 'v1' }
4747

4848
# True to use global NuGet cache instead of restoring packages to repository-local directory.
@@ -262,7 +262,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) {
262262
if (!(Test-Path $installScript)) {
263263
Create-Directory $dotnetRoot
264264
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
265-
$uri = "https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1"
265+
$uri = "https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1"
266266

267267
Retry({
268268
Write-Host "GET $uri"

eng/common/tools.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ warn_as_error=${warn_as_error:-true}
5454
use_installed_dotnet_cli=${use_installed_dotnet_cli:-true}
5555

5656
# Enable repos to use a particular version of the on-line dotnet-install scripts.
57-
# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
57+
# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh
5858
dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'}
5959

6060
# True to use global NuGet cache instead of restoring packages to repository-local directory.
@@ -295,7 +295,7 @@ function with_retries {
295295
function GetDotNetInstallScript {
296296
local root=$1
297297
local install_script="$root/dotnet-install.sh"
298-
local install_script_url="https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh"
298+
local install_script_url="https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh"
299299

300300
if [[ ! -a "$install_script" ]]; then
301301
mkdir -p "$root"

global.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
}
1212
},
1313
"msbuild-sdks": {
14-
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25161.4",
15-
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25161.4",
14+
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25164.2",
15+
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25164.2",
1616
"Microsoft.Build.Traversal": "3.4.0"
1717
}
1818
}

src/VisualStudio/CSharp/Impl/Options/CSharpVisualStudioCopilotOptionsService.cs

+25-15
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
using System;
66
using System.Composition;
7-
using System.Threading;
87
using System.Threading.Tasks;
98
using Microsoft.CodeAnalysis;
109
using Microsoft.CodeAnalysis.Copilot;
1110
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
1211
using Microsoft.CodeAnalysis.Host.Mef;
1312
using Microsoft.Internal.VisualStudio.Shell.Interop;
14-
using Microsoft.VisualStudio.Settings;
1513
using Microsoft.VisualStudio.Shell;
14+
using Microsoft.VisualStudio.Utilities.UnifiedSettings;
1615

1716
namespace Microsoft.VisualStudio.LanguageServices.CSharp.Options;
1817

@@ -40,21 +39,20 @@ internal sealed class CSharpVisualStudioCopilotOptionsService : ICopilotOptionsS
4039
/// </summary>
4140
private const string GitHubAccountStatusIsCopilotEntitled = "3DE3FA6E-91B2-46C1-9E9E-DD04975BB890";
4241

43-
private const string CopilotOptionNamePrefix = "Microsoft.VisualStudio.Conversations";
44-
4542
// Default value must reflect their default values in ConversationsOptions in Copilot repo.
46-
private readonly CopilotOption _copilotCodeAnalysisOption = new("EnableCSharpCodeAnalysis", false);
47-
private readonly CopilotOption _copilotRefineOption = new("EnableCSharpRefineQuickActionSuggestion", false);
48-
private readonly CopilotOption _copilotOnTheFlyDocsOption = new("EnableOnTheFlyDocs", true);
49-
private readonly CopilotOption _copilotGenerateDocumentationCommentOption = new("EnableCSharpGenerateDocumentationComment", true);
50-
private readonly CopilotOption _copilotGenerateMethodImplementationOption = new("EnableCSharpGenerateMethodImplementation", true);
43+
private readonly CopilotOption _copilotCodeAnalysisOption = new("copilot.featureFlags.editor.enableCSharpCodeAnalysis", false);
44+
private readonly CopilotOption _copilotRefineOption = new("copilot.featureFlags.editor.enableCSharpRefineQuickActionSuggestion", false);
45+
private readonly CopilotOption _copilotOnTheFlyDocsOption = new("copilot.general.editor.enableOnTheFlyDocs", true);
46+
private readonly CopilotOption _copilotGenerateDocumentationCommentOption = new("copilot.general.editor.enableGenerateDocumentationComment", true);
47+
private readonly CopilotOption _copilotGenerateMethodImplementationOption = new("copilot.featureFlags.editor.enableCSharpGenerateMethodImplementation", false);
5148

5249
private static readonly UIContext s_copilotHasLoadedUIContext = UIContext.FromUIContextGuid(new Guid(CopilotHasLoadedGuid));
5350
private static readonly UIContext s_gitHubAccountStatusDeterminedContext = UIContext.FromUIContextGuid(new Guid(GitHubAccountStatusDetermined));
5451
private static readonly UIContext s_gitHubAccountStatusIsCopilotEntitledUIContext = UIContext.FromUIContextGuid(new Guid(GitHubAccountStatusIsCopilotEntitled));
5552
private static readonly UIContext s_gitHubAccountStatusSignedInUIContext = UIContext.FromUIContextGuid(new Guid(GitHubAccountStatusSignedIn));
5653

5754
private readonly Task<ISettingsManager> _settingsManagerTask;
55+
private ISettingsReader? _settingsReader;
5856

5957
/// <summary>
6058
/// Determines if Copilot is active and the user is signed in and entitled to use Copilot.
@@ -68,7 +66,7 @@ private static bool IsGithubCopilotLoadedAndSignedIn
6866
[method: ImportingConstructor]
6967
[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
7068
public CSharpVisualStudioCopilotOptionsService(
71-
IVsService<SVsSettingsPersistenceManager, ISettingsManager> settingsManagerService,
69+
IVsService<SVsUnifiedSettingsManager, ISettingsManager> settingsManagerService,
7270
IThreadingContext threadingContext)
7371
{
7472
_settingsManagerTask = settingsManagerService.GetValueAsync(threadingContext.DisposalToken);
@@ -79,11 +77,23 @@ private async Task<bool> IsCopilotOptionEnabledAsync(CopilotOption option)
7977
if (!IsGithubCopilotLoadedAndSignedIn)
8078
return false;
8179

82-
var settingManager = await _settingsManagerTask.ConfigureAwait(false);
83-
// The bool setting is persisted as 0=None, 1=True, 2=False, so it needs to be retrieved as an int.
84-
// If isEnabled is 0 or the value is not persisted, we should return the default value for the option.
85-
var isEnabled = settingManager.GetValueOrDefault($"{CopilotOptionNamePrefix}.{option.Name}", 0);
86-
return isEnabled == 1 || (isEnabled == 0 && option.DefaultValue);
80+
if (_settingsReader == null)
81+
{
82+
var settingsManager = await _settingsManagerTask.ConfigureAwait(false);
83+
_settingsReader = settingsManager.GetReader();
84+
}
85+
86+
try
87+
{
88+
if (_settingsReader.GetValue<bool>(option.Name) is { Outcome: SettingRetrievalOutcome.Success } setting)
89+
return setting.Value;
90+
91+
return option.DefaultValue;
92+
}
93+
catch
94+
{
95+
return option.DefaultValue;
96+
}
8797
}
8898

8999
public Task<bool> IsCodeAnalysisOptionEnabledAsync()

src/VisualStudio/CSharp/Impl/SemanticSearch/SemanticSearchToolWindowImpl.cs

+5
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ public async Task<FrameworkElement> InitializeAsync(CancellationToken cancellati
198198
return null;
199199
}
200200

201+
if (!globalOptions.GetOption(SemanticSearchFeatureFlag.PromptEnabled))
202+
{
203+
return null;
204+
}
205+
201206
var outerGrid = new Grid()
202207
{
203208
Background = (Brush)Application.Current.FindResource(CommonControlsColors.TextBoxBackgroundBrushKey),

src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs

+1
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ public bool TryFetch(LocalUserRegistryOptionPersister persister, OptionKey2 opti
372372
{"dotnet_unsupported_report_invalid_json_patterns", new RoamingProfileStorage("TextEditor.%LANGUAGE%.Specific.ReportInvalidJsonPatterns")},
373373
{"visual_studio_enable_key_binding_reset", new FeatureFlagStorage("Roslyn.KeybindingResetEnabled")},
374374
{"visual_studio_enable_semantic_search", new FeatureFlagStorage("Roslyn.SemanticSearchEnabled")},
375+
{"visual_studio_enable_semantic_search_prompt", new FeatureFlagStorage("Roslyn.ShowPromptInSemanticSearch")},
375376
{"visual_studio_enable_copilot_rename_context", new FeatureFlagStorage("Roslyn.CopilotRenameGetContext")},
376377
{"visual_studio_key_binding_needs_reset", new LocalUserProfileStorage(@"Roslyn\Internal\KeybindingsStatus", "NeedsReset")},
377378
{"visual_studio_key_binding_reset_never_show_again", new LocalUserProfileStorage(@"Roslyn\Internal\KeybindingsStatus", "NeverShowAgain")},

src/VisualStudio/Core/Def/SemanticSearch/SemanticSearchFeatureFlag.cs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace Microsoft.VisualStudio.LanguageServices;
99
internal static class SemanticSearchFeatureFlag
1010
{
1111
public static readonly Option2<bool> Enabled = new("visual_studio_enable_semantic_search", defaultValue: false);
12+
public static readonly Option2<bool> PromptEnabled = new("visual_studio_enable_semantic_search_prompt", defaultValue: false);
1213

1314
/// <summary>
1415
/// Context id that indicates that Semantic Search feature is enabled.

0 commit comments

Comments
 (0)