Skip to content

Commit ffc3289

Browse files
authored
Merge pull request #56127 from dotnet/merges/main-to-main-vs-deps
Merge main to main-vs-deps
2 parents d9df245 + e782ce7 commit ffc3289

File tree

177 files changed

+371
-338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+371
-338
lines changed

src/EditorFeatures/CSharpTest2/Recommendations/RecommenderTests.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
using Microsoft.CodeAnalysis.CSharp;
1616
using Microsoft.CodeAnalysis.CSharp.Extensions;
1717
using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
18+
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
19+
using Microsoft.CodeAnalysis.Test.Utilities;
1820
using Roslyn.Test.Utilities;
1921
using Xunit;
2022

2123
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Recommendations
2224
{
25+
[UseExportProvider]
2326
public abstract class RecommenderTests : TestBase
2427
{
2528
protected static readonly CSharpParseOptions CSharp9ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9);
@@ -55,6 +58,11 @@ private Task VerifyInFrontOfCommentAsync(
5558

5659
private Task CheckResultAsync(string text, int position, bool absent, CSharpParseOptions options, int? matchPriority)
5760
{
61+
using var workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features);
62+
var solution = workspace.CurrentSolution;
63+
var project = solution.AddProject("test", "test", LanguageNames.CSharp);
64+
var document = project.AddDocument("test.cs", text);
65+
5866
var tree = SyntaxFactory.ParseSyntaxTree(text, options: options);
5967
var compilation = CSharpCompilation.Create(
6068
"test",
@@ -67,7 +75,7 @@ private Task CheckResultAsync(string text, int position, bool absent, CSharpPars
6775
}
6876

6977
var semanticModel = compilation.GetSemanticModel(tree);
70-
var context = CSharpSyntaxContext.CreateContext_Test(semanticModel, position, CancellationToken.None);
78+
var context = CSharpSyntaxContext.CreateContext(document, semanticModel, position, CancellationToken.None);
7179
return CheckResultAsync(absent, position, context, matchPriority);
7280
}
7381

src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/CompletionSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ private VSCompletionItem Convert(
462462
insertionText = roslynItem.DisplayText;
463463
}
464464

465-
var supportedPlatforms = SymbolCompletionItem.GetSupportedPlatforms(roslynItem, document.Project.Solution.Workspace);
465+
var supportedPlatforms = SymbolCompletionItem.GetSupportedPlatforms(roslynItem, document.Project.Solution);
466466
var attributeImages = supportedPlatforms != null ? s_WarningImageAttributeImagesArray : ImmutableArray<ImageElement>.Empty;
467467

468468
itemData = new VSCompletionItemData(

src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/EraseKeywordRecommenderTests.vb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.ArrayStatements
66
Public Class EraseKeywordRecommenderTests
7+
Inherits RecommenderTests
8+
79
<Fact>
810
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
911
Public Sub EraseInMethodBodyTest()

src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/PreserveKeywordRecommenderTests.vb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.ArrayStatements
66
Public Class PreserveKeywordRecommenderTests
7+
Inherits RecommenderTests
8+
79
<Fact>
810
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
911
Public Sub PreserveNotInMethodBodyTest()

src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/ReDimKeywordRecommenderTests.vb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.ArrayStatements
66
Public Class ReDimKeywordRecommenderTests
7+
Inherits RecommenderTests
8+
79
<Fact>
810
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
911
Public Sub ReDimInMethodBodyTest()

src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AliasKeywordRecommenderTests.vb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations
66
Public Class AliasKeywordRecommenderTests
7+
Inherits RecommenderTests
8+
79
<Fact>
810
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
911
Public Sub AliasAfterLibNameInSubTest()

src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AsKeywordRecommenderTests.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
' See the LICENSE file in the project root for more information.
44

55
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations
6-
<[UseExportProvider]>
76
Public Class AsKeywordRecommenderTests
7+
Inherits RecommenderTests
88

99
<Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
1010
Public Sub AsInAggregateClause1Test()

src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AsyncKeywordRecommenderTests.vb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations
66
Public Class AsyncKeywordRecommenderTests
7+
Inherits RecommenderTests
78

89
<Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
910
Public Sub KeywordsAfterAsyncTest()

src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AttributeScopesKeywordRecommenderTests.vb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations
66
Public Class AttributeScopeKeywordRecommenderTests
7+
Inherits RecommenderTests
8+
79
<Fact>
810
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
911
Public Sub AttributeScopesInFileTest()

src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CharsetModifierKeywordRecommenderTests.vb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations
66
Public Class CharsetModifierKeywordRecommenderTests
7+
Inherits RecommenderTests
8+
79
<Fact>
810
<Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
911
Public Sub AutoAfterDeclareTest()

0 commit comments

Comments
 (0)