Skip to content

Commit 2038e1a

Browse files
Merge branch 'main' into extractMethodCleanup
2 parents 9304403 + 8bf80c6 commit 2038e1a

20 files changed

+135
-92
lines changed

src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

@@ -13398,15 +13398,16 @@ class C
1339813398
await VerifyAnyItemExistsAsync(source);
1339913399
}
1340013400

13401-
[Fact]
13402-
public async Task AfterScopedInsideMethod()
13401+
[Theory, CombinatorialData]
13402+
public async Task AfterScopedInsideMethod(bool useRef)
1340313403
{
13404-
var source = """
13404+
var refKeyword = useRef ? "ref " : "";
13405+
var source = $$"""
1340513406
class C
1340613407
{
1340713408
void M()
1340813409
{
13409-
scoped $$
13410+
scoped {{refKeyword}}$$
1341013411
}
1341113412
}
1341213413
@@ -13415,24 +13416,54 @@ ref struct MyRefStruct { }
1341513416
await VerifyItemExistsAsync(MakeMarkup(source), "MyRefStruct");
1341613417
}
1341713418

13418-
[Fact]
13419-
public async Task AfterScopedGlobalStatement_FollowedByType()
13419+
[Theory, CombinatorialData]
13420+
public async Task AfterScopedGlobalStatement_FollowedByRefStruct(bool useRef)
1342013421
{
13421-
var source = """
13422-
scoped $$
13422+
var refKeyword = useRef ? "ref " : "";
13423+
var source = $$"""
13424+
scoped {{refKeyword}}$$
1342313425
1342413426
ref struct MyRefStruct { }
1342513427
""";
1342613428
await VerifyItemExistsAsync(MakeMarkup(source), "MyRefStruct");
1342713429
}
1342813430

13429-
[Fact]
13430-
public async Task AfterScopedGlobalStatement_NotFollowedByType()
13431+
[Theory, CombinatorialData]
13432+
public async Task AfterScopedGlobalStatement_FollowedByStruct(bool useRef)
1343113433
{
13432-
var source = """
13434+
var refKeyword = useRef ? "ref " : "";
13435+
var source = $$"""
13436+
using System;
13437+
13438+
scoped {{refKeyword}}$$
13439+
13440+
struct S { }
13441+
""";
13442+
await VerifyItemExistsAsync(MakeMarkup(source), "ReadOnlySpan", displayTextSuffix: "<>");
13443+
}
13444+
13445+
[Theory, CombinatorialData]
13446+
public async Task AfterScopedGlobalStatement_FollowedByPartialStruct(bool useRef)
13447+
{
13448+
var refKeyword = useRef ? "ref " : "";
13449+
var source = $$"""
13450+
using System;
13451+
13452+
scoped {{refKeyword}}$$
13453+
13454+
partial struct S { }
13455+
""";
13456+
await VerifyItemExistsAsync(MakeMarkup(source), "ReadOnlySpan", displayTextSuffix: "<>");
13457+
}
13458+
13459+
[Theory, CombinatorialData]
13460+
public async Task AfterScopedGlobalStatement_NotFollowedByType(bool useRef)
13461+
{
13462+
var refKeyword = useRef ? "ref " : "";
13463+
var source = $"""
1343313464
using System;
1343413465
13435-
scoped $$
13466+
scoped {refKeyword}$$
1343613467
""";
1343713468

1343813469
await VerifyItemExistsAsync(MakeMarkup(source), "ReadOnlySpan", displayTextSuffix: "<>");

src/EditorFeatures/Test2/Rename/RenameTagProducerTests.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public class Class1
352352
void Test(int i) {{ }}
353353
void M()
354354
{{
355-
{{|conflict:{{|conflict:<<<<<<< {String.Format(WorkspacesResources.Unmerged_change_from_project_0, "CSharpAssembly1")}, {WorkspacesResources.Before_colon}
355+
{{|conflict:{{|conflict:<<<<<<< {String.Format(WorkspacesResources.TODO_Unmerged_change_from_project_0, "CSharpAssembly1")}, {WorkspacesResources.Before_colon}
356356
Test(5);
357357
=======
358358
Test((long)5);

src/VisualStudio/CSharp/Test/F1Help/F1HelpTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,17 @@ public class C
19941994
""", "required");
19951995
}
19961996

1997+
[Fact]
1998+
public async Task TestScoped()
1999+
{
2000+
await Test_KeywordAsync("""
2001+
sc[||]oped var r = new R();
2002+
ref struct R
2003+
{
2004+
}
2005+
""", "scoped");
2006+
}
2007+
19972008
[Fact]
19982009
public async Task TestDefaultConstraint()
19992010
{

src/Workspaces/Core/Portable/LinkedFileDiffMerging/AbstractLinkedFileMergeConflictCommentAdditionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private static ImmutableArray<TextChange> GetCommentChangesForDocument(IEnumerab
7676
var newText = oldText.WithChanges(adjustedChanges);
7777

7878
var warningText = GetConflictCommentText(
79-
string.Format(WorkspacesResources.Unmerged_change_from_project_0, projectName),
79+
string.Format(WorkspacesResources.TODO_Unmerged_change_from_project_0, projectName),
8080
TrimBlankLines(oldText),
8181
TrimBlankLines(newText));
8282

src/Workspaces/Core/Portable/WorkspacesResources.resx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@
249249
<data name="Solution_file_not_found_colon_0" xml:space="preserve">
250250
<value>Solution file not found: '{0}'</value>
251251
</data>
252-
<data name="Unmerged_change_from_project_0" xml:space="preserve">
253-
<value>Unmerged change from project '{0}'</value>
252+
<data name="TODO_Unmerged_change_from_project_0" xml:space="preserve">
253+
<value>TODO: Unmerged change from project '{0}'</value>
254+
<comment>{Locked="TODO"}</comment>
254255
</data>
255256
<data name="After" xml:space="preserve">
256257
<value>After</value>

src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)