Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main-vs-deps to main #63355

Merged
merged 61 commits into from
Aug 13, 2022
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
5d4f120
Merge pull request #62964 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 27, 2022
d58c55a
Merge pull request #62966 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 27, 2022
5a681c1
Merge pull request #62967 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 27, 2022
a9e5a33
Merge pull request #62974 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 27, 2022
eaf60a7
Merge pull request #62981 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 27, 2022
06c4d76
Merge pull request #62995 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 27, 2022
29cefc8
Merge pull request #63002 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 27, 2022
67a394d
Merge pull request #63001 from dotnet/merges/release/dev17.4-vs-deps-…
dotnet-bot Jul 28, 2022
c07cc14
Merge pull request #63004 from dotnet/merges/release/dev17.4-vs-deps-…
dotnet-bot Jul 28, 2022
0910a2f
Merge pull request #63007 from dotnet/merges/release/dev17.4-vs-deps-…
dotnet-bot Jul 28, 2022
d35f53c
Merge pull request #63012 from dotnet/merges/release/dev17.4-vs-deps-…
dotnet-bot Jul 28, 2022
d6979ba
Merge pull request #63020 from dotnet/merges/release/dev17.4-vs-deps-…
dotnet-bot Jul 28, 2022
67a96b1
Merge pull request #63021 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 28, 2022
44f60de
Merge pull request #63030 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 28, 2022
2ae908f
Merge pull request #63044 from dotnet/merges/release/dev17.4-vs-deps-…
dotnet-bot Jul 29, 2022
546c22c
Merge branch 'main-vs-deps' into merges/main-to-main-vs-deps
JoeRobich Jul 29, 2022
442d8f4
Merge pull request #63045 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 29, 2022
eafc8c5
Merge pull request #63052 from dotnet/merges/release/dev17.4-vs-deps-…
dotnet-bot Jul 29, 2022
e2373f4
Merge pull request #63049 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 29, 2022
11bd7de
Merge pull request #63060 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 29, 2022
2520267
Merge pull request #63069 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 29, 2022
3817ac9
Merge pull request #63086 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 30, 2022
8452d2f
Merge pull request #63105 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Jul 31, 2022
042d870
Merge pull request #63126 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 2, 2022
6df1687
Merge pull request #63127 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 2, 2022
0d84162
Merge pull request #63128 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 2, 2022
b6ff31a
Merge pull request #63136 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 2, 2022
30cd533
Merge pull request #63143 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 2, 2022
ba79feb
Merge pull request #63154 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 3, 2022
3776d2c
Merge pull request #63157 from dotnet/merges/release/dev17.4-vs-deps-…
dotnet-bot Aug 3, 2022
cc46567
Merge pull request #63158 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 3, 2022
cedcb9e
Merge pull request #63159 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 3, 2022
89c063d
Merge pull request #63171 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 3, 2022
640be5a
Merge pull request #63170 from dotnet/merges/release/dev17.4-vs-deps-…
dotnet-bot Aug 3, 2022
61e7f20
Handle sceanrio where intial completion list contains single non-rosl…
genlu Jul 29, 2022
6c815b2
Merge pull request #63184 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 3, 2022
b8d03d2
Merge pull request #63191 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 4, 2022
cf43595
Merge pull request #63199 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 4, 2022
dbdea24
Merge pull request #63210 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 4, 2022
d2e150f
Merge pull request #63083 from genlu/FixSingleNonRoslynItem
genlu Aug 4, 2022
d617932
Merge pull request #63220 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 4, 2022
48f6b38
Merge pull request #63229 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 5, 2022
2a75cdc
Merge pull request #63233 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 5, 2022
3fe1453
Merge pull request #63237 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 5, 2022
d35ab64
Merge pull request #63242 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 5, 2022
5f774b3
Merge pull request #63247 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 6, 2022
dcfe294
Merge pull request #63248 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 6, 2022
df56d94
Merge branch 'main-vs-deps' into merges/main-to-main-vs-deps
tmat Aug 8, 2022
0461392
fix merge
dibarbet Aug 9, 2022
7432783
Fix formatting
dibarbet Aug 9, 2022
089a562
fix formatting
dibarbet Aug 10, 2022
003d956
Merge pull request #63250 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 10, 2022
919ca71
Merge remote-tracking branch 'upstream/main' into merges/main-to-main…
dibarbet Aug 10, 2022
b3d702b
Merge pull request #63302 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 10, 2022
c2cbc87
Merge pull request #63313 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 10, 2022
bec6690
Merge pull request #63321 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 11, 2022
065c90f
Merge pull request #63323 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 11, 2022
bd11fae
Merge pull request #63327 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 11, 2022
98c4f89
Merge pull request #63346 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 12, 2022
1eb0f43
Merge pull request #63350 from dotnet/merges/main-to-main-vs-deps
dotnet-bot Aug 12, 2022
98989aa
Merge remote-tracking branch 'origin/main' into merges/main-vs-deps-t…
JoeRobich Aug 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@
<MicrosoftVisualStudioExtensibilityTestingVersion>0.1.132-beta</MicrosoftVisualStudioExtensibilityTestingVersion>
<!-- CodeStyleAnalyzerVersion should we updated together with version of dotnet-format in dotnet-tools.json -->
<CodeStyleAnalyzerVersion>4.3.0-1.final</CodeStyleAnalyzerVersion>
<VisualStudioEditorPackagesVersion>17.3.37-preview</VisualStudioEditorPackagesVersion>
<VisualStudioEditorPackagesVersion>17.3.133-preview</VisualStudioEditorPackagesVersion>
<!-- This should generally be set to $(VisualStudioEditorPackagesVersion),
but sometimes EditorFeatures.Cocoa specifically requires a newer editor build. -->
<VisualStudioMacEditorPackagesVersion>17.3.68-preview</VisualStudioMacEditorPackagesVersion>
<VisualStudioMacEditorPackagesVersion>$(VisualStudioEditorPackagesVersion)</VisualStudioMacEditorPackagesVersion>
<ILAsmPackageVersion>5.0.0-alpha1.19409.1</ILAsmPackageVersion>
<ILDAsmPackageVersion>5.0.0-preview.1.20112.8</ILDAsmPackageVersion>
<MicrosoftVisualStudioLanguageServerClientPackagesVersion>17.3.2062-preview</MicrosoftVisualStudioLanguageServerClientPackagesVersion>
<MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>17.3.2017</MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>
<MicrosoftVisualStudioShellPackagesVersion>17.2.32505.113</MicrosoftVisualStudioShellPackagesVersion>
<MicrosoftVisualStudioShellPackagesVersion>17.3.0-preview-1-32407-044</MicrosoftVisualStudioShellPackagesVersion>
<RefOnlyMicrosoftBuildPackagesVersion>16.5.0</RefOnlyMicrosoftBuildPackagesVersion>
<!-- The version of Roslyn we build Source Generators against that are built in this
repository. This must be lower than MicrosoftNetCompilersToolsetVersion,
but not higher than our minimum dogfoodable Visual Studio version, or else
the generators we build would load on the command line but not load in IDEs. -->
<SourceGeneratorMicrosoftCodeAnalysisVersion>4.1.0</SourceGeneratorMicrosoftCodeAnalysisVersion>
<MicrosoftILVerificationVersion>7.0.0-alpha.1.22060.1</MicrosoftILVerificationVersion>
<MicrosoftServiceHubVersion>3.1.4097</MicrosoftServiceHubVersion>
<MicrosoftVisualStudioThreadingPackagesVersion>17.2.32</MicrosoftVisualStudioThreadingPackagesVersion>
<MicrosoftServiceHubVersion>4.0.117</MicrosoftServiceHubVersion>
<MicrosoftVisualStudioThreadingPackagesVersion>17.3.1-alpha</MicrosoftVisualStudioThreadingPackagesVersion>
</PropertyGroup>
<!--
Dependency versions
Expand Down Expand Up @@ -278,7 +278,7 @@
create a test insertion in Visual Studio to validate.
-->
<NewtonsoftJsonVersion>13.0.1</NewtonsoftJsonVersion>
<StreamJsonRpcVersion>2.11.35</StreamJsonRpcVersion>
<StreamJsonRpcVersion>2.12.7-alpha</StreamJsonRpcVersion>
<!--
When updating the S.C.I or S.R.M version please let the MSBuild team know in advance so they
can update to the same version. Version changes require a VS test insertion for validation.
Expand Down
4 changes: 2 additions & 2 deletions eng/targets/GenerateServiceHubConfigurationFiles.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ServiceHubServiceJsonFile Include="$(IntermediateOutputPath)%(_ServicesWithBitness.Identity)%(_ServicesWithBitness.FileSuffix).servicehub.service.json" Runtime="%(_ServicesWithBitness.Runtime)" Condition="'%(_ServicesWithBitness.Runtime)' == 'desktop'" >
<Content>
<![CDATA[{
"host": "desktopClr",
"host": "netfx.anycpu",
"hostId": "RoslynCodeAnalysisService%(_ServicesWithBitness.HostIdSuffix)",
"hostGroupAllowed": true,
"serviceOverride": true,
Expand All @@ -37,7 +37,7 @@
<ServiceHubServiceJsonFile Include="$(IntermediateOutputPath)%(_ServicesWithBitness.Identity)%(_ServicesWithBitness.FileSuffix).servicehub.service.json" Runtime="%(_ServicesWithBitness.Runtime)" Condition="'%(_ServicesWithBitness.Runtime)' == 'core'" >
<Content>
<![CDATA[{
"host": "coreClr",
"host": "dotnet",
"hostId": "RoslynCodeAnalysisService%(_ServicesWithBitness.HostIdSuffix)",
"hostGroupAllowed": true,
"serviceOverride": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor.UnitTests.SpellCheck;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Test.Utilities;
using Roslyn.Test.Utilities;

namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.SpellCheck
{
[UseExportProvider]
public class SpellCheckFixerProviderTests : AbstractSpellCheckFixerProviderTests
{
protected override TestWorkspace CreateWorkspace(string content)
=> TestWorkspace.CreateCSharp(content);

[WpfFact]
public async Task TestRenameClassName()
{
await TestSuccessAsync(
"""
class {|CorrectlySpelled:CrrectlySpelled|}
{
public CrrectlySpelled() { }
}
""",
"""
class CorrectlySpelled
{
public CorrectlySpelled() { }
}
""");
}

[WpfFact]
public async Task TestBogusLocation()
{
// Should not be called inside a string. But we should still apply the change.
await TestFailureAsync(
"""
class C
{
void M()
{
var v1 = "{|word:wrd|}";
var v2 = "wrd";
}
}
""",
"""
class C
{
void M()
{
var v1 = "word";
var v2 = "wrd";
}
}
""");
}

[WpfFact]
public async Task TestReplacementThatLanguageDoesNotSupport()
{
// Should not be called inside a string. But we should still apply the change.
await TestFailureAsync(
"""
class {|Bo()gus:Orginal|}
{
public Orginal() { }
}
""",
"""
class Bo()gus
{
public Orginal() { }
}
""");
}

[WpfFact]
public async Task TestReplacementSpanLargerThanToken()
{
// Replacement span is larger than the lang token to rename.
await TestFailureAsync(
"""
class {|Replacement:Class |}
{
public Class() { }
}
""",
"""
class Replacement
{
public Class() { }
}
""");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal sealed class CompletionSessionData

public SnapshotPoint? ExpandedItemTriggerLocation { get; set; }
public TextSpan? CompletionListSpan { get; set; }
public ImmutableArray<CompletionItem>? CombinedSortedList { get; set; }
public CompletionList<CompletionItem>? CombinedSortedList { get; set; }
public Task<(CompletionContext, RoslynCompletionList)>? ExpandedItemsTask { get; set; }

private CompletionSessionData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public async Task<VSCompletionContext> GetCompletionContextAsync(
if (!options.ShouldShowItemsFromUnimportedNamespaces())
{
// No need to trigger expanded providers at all if the feature is disabled, just trigger core providers and return;
var (context, list) = await GetCompletionContextWorkerAsync(document, trigger, triggerLocation,
var (context, list) = await GetCompletionContextWorkerAsync(session, document, trigger, triggerLocation,
options with { ExpandedCompletionBehavior = ExpandedCompletionMode.NonExpandedItemsOnly }, cancellationToken).ConfigureAwait(false);

UpdateSessionData(session, sessionData, list, triggerLocation);
Expand All @@ -284,7 +284,7 @@ public async Task<VSCompletionContext> GetCompletionContextAsync(
{
// We tie the behavior of delaying expand items to editor's "responsive completion" option.
// i.e. "responsive completion" disabled == always wait for all items to be calculated.
var (context, list) = await GetCompletionContextWorkerAsync(document, trigger, triggerLocation,
var (context, list) = await GetCompletionContextWorkerAsync(session, document, trigger, triggerLocation,
options with { ExpandedCompletionBehavior = ExpandedCompletionMode.AllItems }, cancellationToken).ConfigureAwait(false);

UpdateSessionData(session, sessionData, list, triggerLocation);
Expand All @@ -298,7 +298,7 @@ public async Task<VSCompletionContext> GetCompletionContextAsync(
Stopwatch stopwatch = new();
var expandedItemsTask = Task.Run(async () =>
{
var result = await GetCompletionContextWorkerAsync(document, trigger, triggerLocation,
var result = await GetCompletionContextWorkerAsync(session, document, trigger, triggerLocation,
options with { ExpandedCompletionBehavior = ExpandedCompletionMode.ExpandedItemsOnly }, cancellationToken).ConfigureAwait(false);

// Record how long it takes for the background task to complete *after* core providers returned.
Expand All @@ -313,7 +313,7 @@ public async Task<VSCompletionContext> GetCompletionContextAsync(
}, cancellationToken);

// Now trigger and wait for core providers to return;
var (nonExpandedContext, nonExpandedCompletionList) = await GetCompletionContextWorkerAsync(document, trigger, triggerLocation,
var (nonExpandedContext, nonExpandedCompletionList) = await GetCompletionContextWorkerAsync(session, document, trigger, triggerLocation,
options with { ExpandedCompletionBehavior = ExpandedCompletionMode.NonExpandedItemsOnly }, cancellationToken).ConfigureAwait(false);
UpdateSessionData(session, sessionData, nonExpandedCompletionList, triggerLocation);

Expand All @@ -324,7 +324,7 @@ public async Task<VSCompletionContext> GetCompletionContextAsync(
UpdateSessionData(session, sessionData, expandedCompletionList, triggerLocation);
AsyncCompletionLogger.LogImportCompletionGetContext(isBlocking: false, delayed: false);

return CombineCompletionContext(nonExpandedContext, expandedContext);
return CombineCompletionContext(session, nonExpandedContext, expandedContext);
}
else
{
Expand All @@ -345,24 +345,21 @@ public async Task<VSCompletionContext> GetCompletionContextAsync(
AsyncCompletionLogger.LogSourceGetContextTicksDataPoint(totalStopWatch.Elapsed, isCanceled: cancellationToken.IsCancellationRequested);
}

static VSCompletionContext CombineCompletionContext(VSCompletionContext context1, VSCompletionContext context2)
static VSCompletionContext CombineCompletionContext(IAsyncCompletionSession session, VSCompletionContext context1, VSCompletionContext context2)
{
if (context1.Items.IsEmpty && context1.SuggestionItemOptions is null)
if (context1.ItemList.IsEmpty && context1.SuggestionItemOptions is null)
return context2;

if (context2.Items.IsEmpty && context2.SuggestionItemOptions is null)
if (context2.ItemList.IsEmpty && context2.SuggestionItemOptions is null)
return context1;

using var _ = ArrayBuilder<VSCompletionItem>.GetInstance(context1.Items.Length + context2.Items.Length, out var itemsBuilder);
itemsBuilder.AddRange(context1.Items);
itemsBuilder.AddRange(context2.Items);

var completionList = session.CreateCompletionList(context1.ItemList.Concat(context2.ItemList));
var filterStates = FilterSet.CombineFilterStates(context1.Filters, context2.Filters);

var suggestionItem = context1.SuggestionItemOptions ?? context2.SuggestionItemOptions;
var hint = suggestionItem == null ? AsyncCompletionData.InitialSelectionHint.RegularSelection : AsyncCompletionData.InitialSelectionHint.SoftSelection;

return new VSCompletionContext(itemsBuilder.ToImmutableAndClear(), suggestionItem, hint, filterStates);
return new VSCompletionContext(completionList, suggestionItem, hint, filterStates, isIncomplete: false, properties: null);
}
}

Expand Down Expand Up @@ -408,7 +405,7 @@ public async Task<VSCompletionContext> GetExpandedCompletionContextAsync(
ExpandedCompletionBehavior = ExpandedCompletionMode.ExpandedItemsOnly
};

var (context, completionList) = await GetCompletionContextWorkerAsync(document, intialTrigger, initialTriggerLocation, options, cancellationToken).ConfigureAwait(false);
var (context, completionList) = await GetCompletionContextWorkerAsync(session, document, intialTrigger, initialTriggerLocation, options, cancellationToken).ConfigureAwait(false);
UpdateSessionData(session, sessionData, completionList, initialTriggerLocation);

return context;
Expand All @@ -419,6 +416,7 @@ public async Task<VSCompletionContext> GetExpandedCompletionContextAsync(
}

private async Task<(VSCompletionContext, CompletionList)> GetCompletionContextWorkerAsync(
IAsyncCompletionSession session,
Document document,
AsyncCompletionData.CompletionTrigger trigger,
SnapshotPoint triggerLocation,
Expand All @@ -443,26 +441,19 @@ public async Task<VSCompletionContext> GetExpandedCompletionContextAsync(
document, triggerLocation, options, document.Project.Solution.Options, roslynTrigger, _roles, cancellationToken).ConfigureAwait(false);

var filterSet = new FilterSet();
using var _ = ArrayBuilder<VSCompletionItem>.GetInstance(completionList.ItemsList.Count, out var itemsBuilder);

foreach (var roslynItem in completionList.ItemsList)
{
cancellationToken.ThrowIfCancellationRequested();
var item = Convert(document, roslynItem, filterSet, triggerLocation);
itemsBuilder.Add(item);
}
var completionItemList = session.CreateCompletionList(
completionList.ItemsList.Select(i => Convert(document, i, filterSet, triggerLocation, cancellationToken)));

var filters = filterSet.GetFilterStatesInSet();
var items = itemsBuilder.ToImmutable();

if (completionList.SuggestionModeItem is null)
return (new(items, suggestionItemOptions: null, selectionHint: AsyncCompletionData.InitialSelectionHint.RegularSelection, filters), completionList);
return (new(completionItemList, suggestionItemOptions: null, selectionHint: AsyncCompletionData.InitialSelectionHint.RegularSelection, filters, isIncomplete: false, null), completionList);

var suggestionItemOptions = new AsyncCompletionData.SuggestionItemOptions(
completionList.SuggestionModeItem.DisplayText,
completionList.SuggestionModeItem.Properties.TryGetValue(CommonCompletionItem.DescriptionProperty, out var description) ? description : string.Empty);

return (new(items, suggestionItemOptions, selectionHint: AsyncCompletionData.InitialSelectionHint.SoftSelection, filters), completionList);
return (new(completionItemList, suggestionItemOptions, selectionHint: AsyncCompletionData.InitialSelectionHint.SoftSelection, filters, isIncomplete: false, null), completionList);
}

private static void UpdateSessionData(IAsyncCompletionSession session, CompletionSessionData sessionData, CompletionList completionList, SnapshotPoint triggerLocation)
Expand Down Expand Up @@ -557,10 +548,12 @@ private VSCompletionItem Convert(
Document document,
RoslynCompletionItem roslynItem,
FilterSet filterSet,
SnapshotPoint initialTriggerLocation)
SnapshotPoint initialTriggerLocation,
CancellationToken cancellationToken)
{
VSCompletionItemData itemData;
cancellationToken.ThrowIfCancellationRequested();

VSCompletionItemData itemData;
if (roslynItem.Flags.IsCached() && s_roslynItemToVsItemData.TryGetValue(roslynItem, out var boxedItemData))
{
itemData = boxedItemData.Value;
Expand Down
Loading