diff --git a/src/EditorFeatures/CSharpTest2/Recommendations/RecommenderTests.cs b/src/EditorFeatures/CSharpTest2/Recommendations/RecommenderTests.cs index eacc7d1c61fec..8022c12ca04b1 100644 --- a/src/EditorFeatures/CSharpTest2/Recommendations/RecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest2/Recommendations/RecommenderTests.cs @@ -15,11 +15,14 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces; +using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Recommendations { + [UseExportProvider] public abstract class RecommenderTests : TestBase { protected static readonly CSharpParseOptions CSharp9ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9); @@ -55,6 +58,11 @@ private Task VerifyInFrontOfCommentAsync( private Task CheckResultAsync(string text, int position, bool absent, CSharpParseOptions options, int? matchPriority) { + using var workspace = new TestWorkspace(composition: FeaturesTestCompositions.Features); + var solution = workspace.CurrentSolution; + var project = solution.AddProject("test", "test", LanguageNames.CSharp); + var document = project.AddDocument("test.cs", text); + var tree = SyntaxFactory.ParseSyntaxTree(text, options: options); var compilation = CSharpCompilation.Create( "test", @@ -67,7 +75,7 @@ private Task CheckResultAsync(string text, int position, bool absent, CSharpPars } var semanticModel = compilation.GetSemanticModel(tree); - var context = CSharpSyntaxContext.CreateContext_Test(semanticModel, position, CancellationToken.None); + var context = CSharpSyntaxContext.CreateContext(document, semanticModel, position, CancellationToken.None); return CheckResultAsync(absent, position, context, matchPriority); } diff --git a/src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/CompletionSource.cs b/src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/CompletionSource.cs index 287b32d96104e..34dfadf25dd66 100644 --- a/src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/CompletionSource.cs +++ b/src/EditorFeatures/Core/Implementation/IntelliSense/AsyncCompletion/CompletionSource.cs @@ -462,7 +462,7 @@ private VSCompletionItem Convert( insertionText = roslynItem.DisplayText; } - var supportedPlatforms = SymbolCompletionItem.GetSupportedPlatforms(roslynItem, document.Project.Solution.Workspace); + var supportedPlatforms = SymbolCompletionItem.GetSupportedPlatforms(roslynItem, document.Project.Solution); var attributeImages = supportedPlatforms != null ? s_WarningImageAttributeImagesArray : ImmutableArray.Empty; itemData = new VSCompletionItemData( diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/EraseKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/EraseKeywordRecommenderTests.vb index 35edebd363300..bcaacc0df8fa6 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/EraseKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/EraseKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.ArrayStatements Public Class EraseKeywordRecommenderTests + Inherits RecommenderTests + Public Sub EraseInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/PreserveKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/PreserveKeywordRecommenderTests.vb index 22ea082d2124f..80eb0926c58ec 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/PreserveKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/PreserveKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.ArrayStatements Public Class PreserveKeywordRecommenderTests + Inherits RecommenderTests + Public Sub PreserveNotInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/ReDimKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/ReDimKeywordRecommenderTests.vb index 2b998a0a3af7c..0ef4feb33fea7 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/ReDimKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/ArrayStatements/ReDimKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.ArrayStatements Public Class ReDimKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ReDimInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AliasKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AliasKeywordRecommenderTests.vb index 8fd66f4f2ebc4..857dbc50a1b43 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AliasKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AliasKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class AliasKeywordRecommenderTests + Inherits RecommenderTests + Public Sub AliasAfterLibNameInSubTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AsKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AsKeywordRecommenderTests.vb index a2fb3f4a8a889..9dbb4e0004766 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AsKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AsKeywordRecommenderTests.vb @@ -3,8 +3,8 @@ ' See the LICENSE file in the project root for more information. Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations - <[UseExportProvider]> Public Class AsKeywordRecommenderTests + Inherits RecommenderTests Public Sub AsInAggregateClause1Test() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AsyncKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AsyncKeywordRecommenderTests.vb index 72c180e507aca..924c90415007f 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AsyncKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AsyncKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class AsyncKeywordRecommenderTests + Inherits RecommenderTests Public Sub KeywordsAfterAsyncTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AttributeScopesKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AttributeScopesKeywordRecommenderTests.vb index c015b1860f361..c3ab94a8687fe 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AttributeScopesKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/AttributeScopesKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class AttributeScopeKeywordRecommenderTests + Inherits RecommenderTests + Public Sub AttributeScopesInFileTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CharsetModifierKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CharsetModifierKeywordRecommenderTests.vb index 6932a8c65b494..cbcbccd8c8cfa 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CharsetModifierKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CharsetModifierKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class CharsetModifierKeywordRecommenderTests + Inherits RecommenderTests + Public Sub AutoAfterDeclareTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ClassKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ClassKeywordRecommenderTests.vb index e400b61eacfd7..aba672e7c2853 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ClassKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ClassKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class ClassKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ClassInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ConstKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ConstKeywordRecommenderTests.vb index 99755b0f2d673..da0dc40b5ff5e 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ConstKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ConstKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class ConstKeywordRecommenderTests + Inherits RecommenderTests Public Sub ConstInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CovarianceModifierKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CovarianceModifierKeywordRecommenderTests.vb index c56af8e0411ea..8501941572bf3 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CovarianceModifierKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CovarianceModifierKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class CovarianceModifierKeywordRecommenderTests + Inherits RecommenderTests + Public Sub InAfterOfInInterfaceTypeParamTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CustomEventKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CustomEventKeywordRecommenderTests.vb index 4f5daa877ae1e..9c9deadd2265f 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CustomEventKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/CustomEventKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class CustomEventKeywordRecommenderTests + Inherits RecommenderTests + Public Sub CustomEventInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DeclareKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DeclareKeywordRecommenderTests.vb index 2541a4cfc0f34..35c3598e87f44 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DeclareKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DeclareKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class DeclareKeywordRecommenderTests + Inherits RecommenderTests + Public Sub DeclareInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DelegateKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DelegateKeywordRecommenderTests.vb index 78a44243a74c8..1eaa5ef1c6490 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DelegateKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DelegateKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class DelegateKeywordRecommenderTests + Inherits RecommenderTests + Public Sub DelegateInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DelegateSubFunctionKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DelegateSubFunctionKeywordRecommenderTests.vb index 9e99c7043027f..440b715de934f 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DelegateSubFunctionKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DelegateSubFunctionKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class DelegateSubFunctionKeywordRecommenderTests + Inherits RecommenderTests + Public Sub SubAndFunctionAfterDelegateTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DimKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DimKeywordRecommenderTests.vb index ec5f5136759d6..437cba439002d 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DimKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/DimKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class DimKeywordRecommenderTests + Inherits RecommenderTests Public Sub DimInMethodDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EndBlockKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EndBlockKeywordRecommenderTests.vb index d94e0237a6a6d..cd059dfefd6b1 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EndBlockKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EndBlockKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class EndBlockKeywordRecommenderTests + Inherits RecommenderTests + Public Sub EndSubInBrokenMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EnumKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EnumKeywordRecommenderTests.vb index aca345c4fa9f9..e75e565713a86 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EnumKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EnumKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class EnumKeywordRecommenderTests + Inherits RecommenderTests + Public Sub EnumInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EventKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EventKeywordRecommenderTests.vb index f0d78b10f3ce9..2b614085a2634 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EventKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/EventKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class EventKeywordRecommenderTests + Inherits RecommenderTests + Public Sub EventInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ExternalSubFunctionKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ExternalSubFunctionKeywordRecommenderTests.vb index 4006a3b4ad633..8c87a52cb2276 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ExternalSubFunctionKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ExternalSubFunctionKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class ExternalSubFunctionKeywordRecommenderTests + Inherits RecommenderTests + Public Sub SubAfterDeclareTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/FunctionKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/FunctionKeywordRecommenderTests.vb index 124294516fdfb..c1f6b3f45a277 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/FunctionKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/FunctionKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class FunctionKeywordRecommenderTests + Inherits RecommenderTests Public Sub FunctionInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/GenericConstraintsKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/GenericConstraintsKeywordRecommenderTests.vb index 54e9dc609217c..b6178b3f95450 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/GenericConstraintsKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/GenericConstraintsKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class GenericConstraintsKeywordRecommenderTests + Inherits RecommenderTests + Public Sub AllAfterAsInSingleConstraintTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/GetSetKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/GetSetKeywordRecommenderTests.vb index 86c322fcde28c..9393d8ef28fa1 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/GetSetKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/GetSetKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class GetSetKeywordRecommenderTests + Inherits RecommenderTests + Public Sub GetAndSetAfterAutoPropTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/HandlesKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/HandlesKeywordRecommenderTests.vb index d7e4d16e0b8f6..ea5fa1413fb62 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/HandlesKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/HandlesKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class HandlesKeywordRecommenderTests + Inherits RecommenderTests Public Sub HandlesAfterMethodInClassTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ImplementsKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ImplementsKeywordRecommenderTests.vb index 329b951cc039b..49422d308c981 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ImplementsKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ImplementsKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class ImplementsKeywordRecommenderTests + Inherits RecommenderTests Public Sub ImplementsAfterClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ImportsKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ImportsKeywordRecommenderTests.vb index e10b02c359004..d61f938cd2456 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ImportsKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ImportsKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.ImportsKeywordRecommender Public Class OptionKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ImportsInBlankFileTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InKeywordRecommenderTests.vb index efc9467963f75..4d6cb61d12240 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class InKeywordRecommenderTests + Inherits RecommenderTests + Public Sub InInForEach1Test() VerifyRecommendationsContain(For Each x |, "In") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InheritsKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InheritsKeywordRecommenderTests.vb index 0ec662af8d746..94bba7eeda11d 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InheritsKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InheritsKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class InheritsKeywordRecommenderTests + Inherits RecommenderTests + Public Sub InheritsAfterClassDeclarationTest() VerifyRecommendationsContain( diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InterfaceKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InterfaceKeywordRecommenderTests.vb index 165b723cb3d49..5db5f131db82d 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InterfaceKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/InterfaceKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class InterfaceKeywordRecommenderTests + Inherits RecommenderTests + Public Sub InterfaceInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/IteratorKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/IteratorKeywordRecommenderTests.vb index 69ea5b50a7844..d8697692f1417 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/IteratorKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/IteratorKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class IteratorKeywordRecommenderTests + Inherits RecommenderTests Public Sub KeywordsAfterIteratorTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/LibKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/LibKeywordRecommenderTests.vb index bba5f10ecd356..3041722540d05 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/LibKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/LibKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class LibKeywordRecommenderTests + Inherits RecommenderTests + Public Sub LibAfterNameInSubTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideClassDeclaration.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideClassDeclaration.vb index 1c732cf40bfc2..13737c0c04724 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideClassDeclaration.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideClassDeclaration.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations.ModifierKeywordRecommenderTests Public Class InsideClassDeclaration + Inherits RecommenderTests #Region "Scope Keywords" diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideInterfaceDeclaration.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideInterfaceDeclaration.vb index a2c1fa3e2ae5f..f2ae5e8d7f292 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideInterfaceDeclaration.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideInterfaceDeclaration.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations.ModifierKeywordRecommenderTests Public Class InsideInterfaceDeclaration + Inherits RecommenderTests #Region "Scope Keywords" diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideModuleDeclaration.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideModuleDeclaration.vb index 0867254e636bc..79a461f65b857 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideModuleDeclaration.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideModuleDeclaration.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations.ModifierKeywordRecommenderTests Public Class InsideModuleDeclaration + Inherits RecommenderTests diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideNamespaceDeclaration.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideNamespaceDeclaration.vb index 233a2ece460ec..ac95a446a2152 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideNamespaceDeclaration.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideNamespaceDeclaration.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations.ModifierKeywordRecommenderTests Public Class InsideNamespaceDeclaration + Inherits RecommenderTests ''' ''' Declarations outside of any namespace in the file are considered to be in the project's root namespace diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideStructureDeclaration.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideStructureDeclaration.vb index c6c2b782c6c54..4c92de2976019 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideStructureDeclaration.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModifierKeywordRecommenderTests.InsideStructureDeclaration.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations.ModifierKeywordRecommenderTests Public Class InsideStructureDeclaration + Inherits RecommenderTests #Region "Scope Keywords" diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModuleKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModuleKeywordRecommenderTests.vb index 3c3f8fa8de7ec..8fa23e23e4841 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModuleKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ModuleKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class ModuleKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ModuleInFileTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/NamespaceKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/NamespaceKeywordRecommenderTests.vb index a3ca9a97df458..bcda77ed6bf46 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/NamespaceKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/NamespaceKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class NamespaceKeywordRecommenderTests + Inherits RecommenderTests + Public Sub NamespaceInFileTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/OfKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/OfKeywordRecommenderTests.vb index d7abd14f5f692..0c2d5025b34ef 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/OfKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/OfKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class OfKeywordRecommenderTests + Inherits RecommenderTests Public Sub OfAfterPossibleMethodTypeParamTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/OperatorKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/OperatorKeywordRecommenderTests.vb index 8a4e9448deb11..455d721b01291 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/OperatorKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/OperatorKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class OperatorKeywordRecommenderTests + Inherits RecommenderTests + Public Sub OperatorInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ParameterModifiersKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ParameterModifiersKeywordRecommenderTests.vb index 9116708a00a92..1148b7c5260c8 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ParameterModifiersKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ParameterModifiersKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class ParameterModifiersKeywordRecommenderTests + Inherits RecommenderTests Public Sub AllRecommendationsForFirstParameterTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/PropertyKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/PropertyKeywordRecommenderTests.vb index 5450030572056..c9704a6991fbd 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/PropertyKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/PropertyKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class PropertyKeywordRecommenderTests + Inherits RecommenderTests Public Sub PropertyInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/StaticKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/StaticKeywordRecommenderTests.vb index df63959f75707..b2f9cbef34e67 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/StaticKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/StaticKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class StaticKeywordRecommenderTests + Inherits RecommenderTests + Public Sub StaticInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/StructureKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/StructureKeywordRecommenderTests.vb index b408575786e11..baf111903588c 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/StructureKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/StructureKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class StructureKeywordRecommenderTests + Inherits RecommenderTests + Public Sub StructureInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/SubKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/SubKeywordRecommenderTests.vb index ecc219f57976f..a6c06ea7a3951 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/SubKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/SubKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class SubKeywordRecommenderTests + Inherits RecommenderTests Public Sub SubInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ToKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ToKeywordRecommenderTests.vb index cb4c2d42109e4..520f0ebf4f695 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ToKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Declarations/ToKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations Public Class ToKeywordRecommenderTests + Inherits RecommenderTests Public Sub NoToWithEmptyBoundInDimTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/AddHandlerKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/AddHandlerKeywordRecommenderTests.vb index f872c0209819d..00cb4d1570a10 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/AddHandlerKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/AddHandlerKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.EventHandling Public Class AddHandlerKeywordRecommenderTests + Inherits RecommenderTests + Public Sub AddHandlerHelpTextTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/RaiseEventKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/RaiseEventKeywordRecommenderTests.vb index 95846f9458b5b..228373bbaf320 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/RaiseEventKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/RaiseEventKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.EventHandling Public Class RaiseEventKeywordRecommenderTests + Inherits RecommenderTests + diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/RemoveHandlerKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/RemoveHandlerKeywordRecommenderTests.vb index 2fdb6a9b90fa9..de9c74941ef78 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/RemoveHandlerKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/EventHandling/RemoveHandlerKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.EventHandling Public Class RemoveHandlerKeywordRecommenderTests + Inherits RecommenderTests + Public Sub RemoveHandlerHelpTextTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/AddressOfKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/AddressOfKeywordRecommenderTests.vb index 2cfaa358d5e1a..daafc64aa7a87 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/AddressOfKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/AddressOfKeywordRecommenderTests.vb @@ -5,6 +5,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions <[UseExportProvider]> Public Class AddressOfKeywordRecommenderTests + Inherits RecommenderTests Public Sub NoneInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/BinaryOperatorKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/BinaryOperatorKeywordRecommenderTests.vb index 876f9c0a25d7e..be9e39af3210a 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/BinaryOperatorKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/BinaryOperatorKeywordRecommenderTests.vb @@ -6,6 +6,8 @@ Imports Microsoft.CodeAnalysis.VisualBasic.Completion.KeywordRecommenders.Expres Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class BinaryOperatorKeywordRecommenderTests + Inherits RecommenderTests + Private Shared ReadOnly s_expectedKeywords As String() = BinaryOperatorKeywordRecommender.KeywordList.Select(Function(k) k.Keyword).ToArray() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/CastOperatorsKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/CastOperatorsKeywordRecommenderTests.vb index 95f3fee7c551e..dd83ccbc281c5 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/CastOperatorsKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/CastOperatorsKeywordRecommenderTests.vb @@ -6,6 +6,8 @@ Imports Microsoft.CodeAnalysis.VisualBasic.Completion.KeywordRecommenders.Expres Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class CastOperatorsKeywordRecommenderTests + Inherits RecommenderTests + Private Shared ReadOnly Property AllTypeConversionOperatorKeywords As String() Get Dim keywords As New List(Of String) From {"CType", "DirectCast", "TryCast"} diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/FromKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/FromKeywordRecommenderTests.vb index ef3df52ef282b..94b8fb98a232d 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/FromKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/FromKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class FromKeywordRecommenderTests + Inherits RecommenderTests + Public Sub NoneInClassDeclarationTest() VerifyRecommendationsMissing(|, "From") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GetTypeKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GetTypeKeywordRecommenderTests.vb index dee68d000af4d..f9c3d9f9420e4 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GetTypeKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GetTypeKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class GetTypeKeywordRecommenderTests + Inherits RecommenderTests + Public Sub GetTypeHelpTextTest() VerifyRecommendationDescriptionTextIs(Return |, "GetType", diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GetXmlNamespaceKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GetXmlNamespaceKeywordRecommenderTests.vb index d5c98fe9ab719..273beac74ae05 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GetXmlNamespaceKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GetXmlNamespaceKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class GetXmlNamespaceKeywordRecommenderTests + Inherits RecommenderTests + Public Sub GetXmlNamespaceHelpTextTest() VerifyRecommendationDescriptionTextIs(Return |, "GetXmlNamespace", diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GlobalKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GlobalKeywordRecommenderTests.vb index 3d82c8ca607e9..193d9451d74cc 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GlobalKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/GlobalKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class GlobalKeywordRecommenderTests + Inherits RecommenderTests Public Sub NoneInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/IfKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/IfKeywordRecommenderTests.vb index b8d9a52ee57f8..6df53156c7e4a 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/IfKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/IfKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class IfKeywordRecommenderTests + Inherits RecommenderTests + Public Sub IfHelpTextTest() VerifyRecommendationDescriptionTextIs(Return |, "If", diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/KeyKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/KeyKeywordRecommenderTests.vb index 1c3bb246d64d0..afc76d0941ff1 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/KeyKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/KeyKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class KeyKeywordRecommenderTests + Inherits RecommenderTests + Public Sub KeyNotInStatementTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/LambdaKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/LambdaKeywordRecommenderTests.vb index 61d31849f6fcc..f116a656988af 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/LambdaKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/LambdaKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class LambdaKeywordRecommenderTests + Inherits RecommenderTests + ' TODO: potentially restrict this to smarter cases where you'd need a parenthesis around the lambda to actually ' call it diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MeKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MeKeywordRecommenderTests.vb index 32901f66489cd..2190cb704ac85 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MeKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MeKeywordRecommenderTests.vb @@ -6,6 +6,8 @@ Imports Microsoft.CodeAnalysis.Completion.Providers Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class MeKeywordRecommenderTests + Inherits RecommenderTests + Public Sub NoneInClassDeclarationTest() VerifyRecommendationsMissing(|, "Me") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MyBaseKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MyBaseKeywordRecommenderTests.vb index e22268b075dbd..3dcf03c354c66 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MyBaseKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MyBaseKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class MyBaseKeywordRecommenderTests + Inherits RecommenderTests + Public Sub NoneInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MyClassKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MyClassKeywordRecommenderTests.vb index 0cf8d73dcf5c5..abd6068f62693 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MyClassKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/MyClassKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class MyClassKeywordRecommenderTests + Inherits RecommenderTests + Public Sub NoneInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NameOfKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NameOfKeywordRecommenderTests.vb index 5075e909fe874..615764b46c02b 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NameOfKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NameOfKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class NameOfKeywordRecommenderTests + Inherits RecommenderTests Public Sub NotInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NewKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NewKeywordRecommenderTests.vb index 944dd28ff3eb2..a0191ceeba6f8 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NewKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NewKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class NewKeywordRecommenderTests + Inherits RecommenderTests Public Sub NewNotInStatementTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NotKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NotKeywordRecommenderTests.vb index 7b619b94afce4..7f1b45af235cd 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NotKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NotKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class NotKeywordRecommenderTests + Inherits RecommenderTests Public Sub NoneInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NothingKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NothingKeywordRecommenderTests.vb index f5fc73cd32df5..096d3e8788ed4 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NothingKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/NothingKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class NothingKeywordRecommenderTests + Inherits RecommenderTests Public Sub NoneInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/TrueFalseKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/TrueFalseKeywordRecommenderTests.vb index ac2421583a539..7dfc077d7fb8a 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/TrueFalseKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/TrueFalseKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class TrueFalseKeywordRecommenderTests + Inherits RecommenderTests + Public Sub NoneInClassDeclarationTest() VerifyRecommendationsMissing(|, "True", "False") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/TypeOfKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/TypeOfKeywordRecommenderTests.vb index 1c7709ab87646..e5efe02746baf 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/TypeOfKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/TypeOfKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class TypeOfKeywordRecommenderTests + Inherits RecommenderTests Public Sub NoneInClassDeclarationTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/WithKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/WithKeywordRecommenderTests.vb index 8ea44bc5d310b..7ef294e7b9f2e 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/WithKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Expressions/WithKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Expressions Public Class WithKeywordRecommenderTests + Inherits RecommenderTests + Public Sub NoneInClassDeclarationTest() VerifyRecommendationsMissing(|, "With") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/ErrorKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/ErrorKeywordRecommenderTests.vb index 147bbe54346e0..9e6b7d998e162 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/ErrorKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/ErrorKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OnErrorStatements Public Class ErrorKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ErrorOptionsAfterOnTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/GoToDestinationsRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/GoToDestinationsRecommenderTests.vb index d43fa59e82ca4..460711c504a88 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/GoToDestinationsRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/GoToDestinationsRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OnErrorStatements Public Class GoToDestinationsRecommenderTests + Inherits RecommenderTests + Public Sub ZeroAndOneAfterOnErrorGotoTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/GoToKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/GoToKeywordRecommenderTests.vb index be3c67dbae2a2..a5d96997b0536 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/GoToKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/GoToKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OnErrorStatements Public Class GoToKeywordRecommenderTests + Inherits RecommenderTests + Public Sub GoToAfterOnErrorTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/NextKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/NextKeywordRecommenderTests.vb index bef4e6e72c660..e82e0b38f53fd 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/NextKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/NextKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OnErrorStatements Public Class NextKeywordRecommenderTests + Inherits RecommenderTests + Public Sub NextAfterOnErrorResumeTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/OnErrorKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/OnErrorKeywordRecommenderTests.vb index 9bc1f3c07865a..d61b447cffad1 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/OnErrorKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/OnErrorKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OnErrorStatements Public Class OnErrorKeywordRecommenderTests + Inherits RecommenderTests + Public Sub OnErrorResumeNextInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/ResumeKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/ResumeKeywordRecommenderTests.vb index c47b85b5e6889..bef2106e101a1 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/ResumeKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OnErrorStatements/ResumeKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OnErrorStatements Public Class ResumeKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ResumeNextAfterOnErrorTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/CompareOptionsRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/CompareOptionsRecommenderTests.vb index 8a1c6f6600613..713e8a09694d6 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/CompareOptionsRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/CompareOptionsRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OptionStatements Public Class CompareOptionsRecommenderTests + Inherits RecommenderTests + Public Sub OptionsAfterOptionCompareTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/ExplicitOptionsRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/ExplicitOptionsRecommenderTests.vb index 5768a640eb8eb..af3c68029f016 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/ExplicitOptionsRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/ExplicitOptionsRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OptionStatements Public Class ExplicitOptionsRecommenderTests + Inherits RecommenderTests + Public Sub OptionsAfterOptionExplicitTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/InferOptionsRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/InferOptionsRecommenderTests.vb index a32d7155a0c0e..e9408bebc9e39 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/InferOptionsRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/InferOptionsRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OptionStatements Public Class InferOptionsRecommenderTests + Inherits RecommenderTests + Public Sub OptionsAfterOptionInferTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/OptionKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/OptionKeywordRecommenderTests.vb index a88e5ae9647f9..4cc2d29b17cec 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/OptionKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/OptionKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OptionStatements Public Class OptionKeywordRecommenderTests + Inherits RecommenderTests + Public Sub OptionInBlankFileTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/OptionNamesRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/OptionNamesRecommenderTests.vb index 7bf3d49f6d693..b2c11b9c18f6e 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/OptionNamesRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/OptionNamesRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OptionStatements Public Class OptionNamesRecommenderTests + Inherits RecommenderTests + Public Sub OptionNamesAfterOptionTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/StrictOptionsRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/StrictOptionsRecommenderTests.vb index dcadc07435ee7..42f836cc0e71b 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/StrictOptionsRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/OptionStatements/StrictOptionsRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.OptionStatements Public Class StrictOptionsRecommenderTests + Inherits RecommenderTests + Public Sub OptionsAfterOptionStrictTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ConstDirectiveKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ConstDirectiveKeywordRecommenderTests.vb index 57dfb2f1990be..f6665f77efcc9 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ConstDirectiveKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ConstDirectiveKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.PreprocessorDirectives Public Class ConstDirectiveKeywordRecommenderTests + Inherits RecommenderTests + Public Sub HashConstInFileTest() VerifyRecommendationsContain(|, "#Const") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ElseDirectiveKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ElseDirectiveKeywordRecommenderTests.vb index a690870dccb33..ae4d32eef0774 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ElseDirectiveKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ElseDirectiveKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.PreprocessorDirectives Public Class ElseDirectiveKeywordRecommenderTests + Inherits RecommenderTests + Public Sub HashElseNotInFileTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ElseIfDirectiveKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ElseIfDirectiveKeywordRecommenderTests.vb index a133ebec96d3b..f520e4b923094 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ElseIfDirectiveKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ElseIfDirectiveKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.PreprocessorDirectives Public Class ElseIfDirectiveKeywordRecommenderTests + Inherits RecommenderTests + Public Sub HashElseIfNotInFileTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/EndIfDirectiveKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/EndIfDirectiveKeywordRecommenderTests.vb index 02bc07ae10d18..f136af884f68e 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/EndIfDirectiveKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/EndIfDirectiveKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.PreprocessorDirectives Public Class EndIfDirectiveKeywordRecommenderTests + Inherits RecommenderTests + Public Sub HashEndIfNotInFileTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/EndRegionDirectiveKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/EndRegionDirectiveKeywordRecommenderTests.vb index f0bb72f443713..fe37fdc1f65a2 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/EndRegionDirectiveKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/EndRegionDirectiveKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.PreprocessorDirectives Public Class EndRegionDirectiveKeywordRecommenderTests + Inherits RecommenderTests + Public Sub HashEndRegionNotInFileTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/IfDirectiveKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/IfDirectiveKeywordRecommenderTests.vb index 2f6e6f0ad3a63..7792940693277 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/IfDirectiveKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/IfDirectiveKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.PreprocessorDirectives Public Class IfDirectiveKeywordRecommenderTests + Inherits RecommenderTests + Public Sub HashIfInFileTest() VerifyRecommendationsContain(|, "#If") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ReferenceDirectiveKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ReferenceDirectiveKeywordRecommenderTests.vb index 7ab5d7bcc4441..531a13a48157b 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ReferenceDirectiveKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/ReferenceDirectiveKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.PreprocessorDirectives Public Class ReferenceDirectiveKeywordRecommenderTests + Inherits RecommenderTests + Public Sub NotInFileTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/RegionDirectiveKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/RegionDirectiveKeywordRecommenderTests.vb index 08980e2498eac..c87f403a50332 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/RegionDirectiveKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/RegionDirectiveKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.PreprocessorDirectives Public Class RegionDirectiveKeywordRecommenderTests + Inherits RecommenderTests + Public Sub HashRegionInFileTest() VerifyRecommendationsContain(|, "#Region") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/WarningDirectiveKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/WarningDirectiveKeywordRecommenderTests.vb index af4c5d103f845..66fe4264c142b 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/WarningDirectiveKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/PreprocessorDirectives/WarningDirectiveKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.PreprocessorDirectives Public Class WarningDirectiveKeywordRecommenderTests + Inherits RecommenderTests + Public Sub HashEnableWarningInFileTest() VerifyRecommendationsContain(|, "#Enable Warning") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/AggregateKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/AggregateKeywordRecommenderTests.vb index d4a58a54981b5..39ff31b47ac38 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/AggregateKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/AggregateKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class AggregateKeywordRecommenderTests + Inherits RecommenderTests Public Sub AggregateNotInStatementTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/AscendingDescendingKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/AscendingDescendingKeywordRecommenderTests.vb index 0c11103a46521..65c97b849a375 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/AscendingDescendingKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/AscendingDescendingKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class AscendingDescendingKeywordRecommenderTests + Inherits RecommenderTests + Public Sub AscendingDescendingNotInStatementTest() VerifyRecommendationsMissing(|, "Ascending", "Descending") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/EqualsKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/EqualsKeywordRecommenderTests.vb index c9d16a27fe907..730c685d0b068 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/EqualsKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/EqualsKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class EqualsKeywordRecommenderTests + Inherits RecommenderTests + Public Sub EqualsAfterJoinInOnIdentifierTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/FromKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/FromKeywordRecommenderTests.vb index bb86212c6a284..c548369e73bcb 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/FromKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/FromKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class FromKeywordRecommenderTests + Inherits RecommenderTests Public Sub FromNotInStatementTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/GroupKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/GroupKeywordRecommenderTests.vb index ae16c08c1bb19..47e3262acff43 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/GroupKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/GroupKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class GroupKeywordRecommenderTests + Inherits RecommenderTests + Public Sub GroupNotInStatementTest() VerifyRecommendationsMissing(|, "Group") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/IntoKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/IntoKeywordRecommenderTests.vb index 9abf1384490f8..30e712d8c03ae 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/IntoKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/IntoKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class IntoKeywordRecommenderTests + Inherits RecommenderTests + Public Sub IntoAfterAnonymousObjectCreationExprTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/JoinKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/JoinKeywordRecommenderTests.vb index 55b6f57db9a73..3e31b64d89844 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/JoinKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/JoinKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class JoinKeywordRecommenderTests + Inherits RecommenderTests + Public Sub JoinNotInStatementTest() VerifyRecommendationsMissing(|, "Join") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/LetKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/LetKeywordRecommenderTests.vb index 9ea182ad5bfa4..c3cf3a6e2401e 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/LetKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/LetKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class LetKeywordRecommenderTests + Inherits RecommenderTests + Public Sub LetNotInStatementTest() VerifyRecommendationsMissing(|, "Let") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/OrderByKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/OrderByKeywordRecommenderTests.vb index c01adce35a46e..3129a9de6b935 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/OrderByKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/OrderByKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class OrderByKeywordRecommenderTests + Inherits RecommenderTests + Public Sub OrderByNotInStatementTest() VerifyRecommendationsMissing(|, "Order By") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/SelectKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/SelectKeywordRecommenderTests.vb index 754994227a9e8..a49f2f84fe370 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/SelectKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/SelectKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class SelectKeywordRecommenderTests + Inherits RecommenderTests + Public Sub SelectInQueryTest() VerifyRecommendationsContain(Dim x = From y In z |, "Select") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/WhereKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/WhereKeywordRecommenderTests.vb index dae9d3ba7d109..affeb6d5626a7 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/WhereKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Queries/WhereKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Queries Public Class WhereKeywordRecommenderTests + Inherits RecommenderTests + Public Sub WhereNotInStatementTest() VerifyRecommendationsMissing(|, "Where") diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/RecommendationTestHelpers.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/RecommendationTestHelpers.vb index 682cf8764e45b..216471fd5ef8a 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/RecommendationTestHelpers.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/RecommendationTestHelpers.vb @@ -5,6 +5,7 @@ Imports System.Collections.Immutable Imports System.Threading Imports Microsoft.CodeAnalysis.Completion.Providers +Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Completion.KeywordRecommenders Imports Microsoft.CodeAnalysis.VisualBasic.Extensions.ContextQuery @@ -23,13 +24,20 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations ToList() End If - Dim parseOptions = New VisualBasicParseOptions().WithKind(kind) - Dim tree = DirectCast(SyntaxFactory.ParseSyntaxTree(SourceText.From(source), parseOptions), VisualBasicSyntaxTree) - Dim comp = VisualBasicCompilation.Create("Text", syntaxTrees:={tree}, references:={TestMetadata.Net451.mscorlib}) - Dim semanticModel = comp.GetSemanticModel(tree) + Using workspace = New TestWorkspace(composition:=FeaturesTestCompositions.Features) + Dim solution = workspace.CurrentSolution + Dim project = solution.AddProject("test", "test", LanguageNames.VisualBasic) + Dim document = project.AddDocument("test.cs", source) + + Dim parseOptions = New VisualBasicParseOptions().WithKind(kind) + Dim tree = DirectCast(SyntaxFactory.ParseSyntaxTree(SourceText.From(source), parseOptions), VisualBasicSyntaxTree) + Dim comp = VisualBasicCompilation.Create("test", syntaxTrees:={tree}, references:={TestMetadata.Net451.mscorlib}) + Dim semanticModel = comp.GetSemanticModel(tree) + + Dim context = VisualBasicSyntaxContext.CreateContext(document, semanticModel, position, CancellationToken.None) + Return s_parts.SelectMany(Function(part) part.RecommendKeywords_Test(context)) + End Using - Dim context = VisualBasicSyntaxContext.TestAccessor.CreateContext(semanticModel, position, CancellationToken.None) - Return s_parts.SelectMany(Function(part) part.RecommendKeywords_Test(context)) End Function Private Function GetRecommendedKeywordStrings(source As String, position As Integer, kind As SourceCodeKind) As IEnumerable(Of String) diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/RecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/RecommenderTests.vb new file mode 100644 index 0000000000000..dbb657446e701 --- /dev/null +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/RecommenderTests.vb @@ -0,0 +1,13 @@ +' 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. + +Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations + ''' + ''' Base class for all recommender tests. + ''' + + Public MustInherit Class RecommenderTests + + End Class +End Namespace diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CallKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CallKeywordRecommenderTests.vb index 4b78d1112447b..8aebb9884c4fa 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CallKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CallKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class CallKeywordRecommenderTests + Inherits RecommenderTests + Public Sub CallInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CaseKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CaseKeywordRecommenderTests.vb index e54fd4dbb4e8b..c969ad50945e2 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CaseKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CaseKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class CaseKeywordRecommenderTests + Inherits RecommenderTests + Public Sub CaseAfterSelectTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CatchKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CatchKeywordRecommenderTests.vb index 17be2273cd16e..f27b5ca362ddf 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CatchKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/CatchKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class CatchKeywordRecommenderTests + Inherits RecommenderTests + Public Sub CatchNotInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ContinueKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ContinueKeywordRecommenderTests.vb index bfdfb17ba74e0..b75d36db7f3a6 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ContinueKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ContinueKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class ContinueKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ContinueNotInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/DoKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/DoKeywordRecommenderTests.vb index 1a6ae30767c21..ac41a37c503da 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/DoKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/DoKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class DoKeywordRecommenderTests + Inherits RecommenderTests Public Sub DoInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/EachKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/EachKeywordRecommenderTests.vb index a335818fbe64f..b3e6dfdef08d3 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/EachKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/EachKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class EachKeywordRecommenderTests + Inherits RecommenderTests + Public Sub EachNotInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ElseIfKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ElseIfKeywordRecommenderTests.vb index c1783a86df9dd..13a0e03f55015 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ElseIfKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ElseIfKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class ElseIfKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ElseIfNotInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ElseKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ElseKeywordRecommenderTests.vb index b811dc2249de9..4cc9b0a029f23 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ElseKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ElseKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class ElseKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ElseNotInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/EndKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/EndKeywordRecommenderTests.vb index 0fcb070505e3a..0953d765088b8 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/EndKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/EndKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class EndKeywordRecommenderTests + Inherits RecommenderTests Public Sub EndInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ExitKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ExitKeywordRecommenderTests.vb index 57dd393d7083d..3952b161d4f3c 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ExitKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ExitKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class ExitKeywordRecommenderTests + Inherits RecommenderTests Public Sub ExitInSubBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/FinallyKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/FinallyKeywordRecommenderTests.vb index 16028ba0da7aa..d9ae6fcb4efea 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/FinallyKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/FinallyKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class FinallyKeywordRecommenderTests + Inherits RecommenderTests + Public Sub FinallyNotInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ForKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ForKeywordRecommenderTests.vb index ce7cc6fbed7c5..3b4bdd6c18c1b 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ForKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ForKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class ForKeywordRecommenderTests + Inherits RecommenderTests Public Sub ForInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/GoToKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/GoToKeywordRecommenderTests.vb index 6b2399d39c38c..a1ba65862ec61 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/GoToKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/GoToKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class GoToKeywordRecommenderTests + Inherits RecommenderTests Public Sub GoToInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/IfKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/IfKeywordRecommenderTests.vb index b901a99043d5f..530088d7a962f 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/IfKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/IfKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class IfKeywordRecommenderTests + Inherits RecommenderTests + Public Sub IfInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/IsKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/IsKeywordRecommenderTests.vb index fc093ce38612e..332bf9cd94b01 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/IsKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/IsKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class IsKeywordRecommenderTests + Inherits RecommenderTests diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/LoopKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/LoopKeywordRecommenderTests.vb index 38b560af3d360..c04a33f5d2d40 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/LoopKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/LoopKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class LoopKeywordRecommenderTests + Inherits RecommenderTests + Public Sub LoopNotInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/MidKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/MidKeywordRecommenderTests.vb index 83b7c81c26b33..b961813f42545 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/MidKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/MidKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class MidKeywordRecommenderTests + Inherits RecommenderTests + Public Sub MidHelpTextTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/NextKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/NextKeywordRecommenderTests.vb index 8306a20acbd30..3d617973e847c 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/NextKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/NextKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class NextKeywordRecommenderTests + Inherits RecommenderTests + Public Sub NextNotInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ReturnKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ReturnKeywordRecommenderTests.vb index 2bd61e97d833b..f23acb495ef3c 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ReturnKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ReturnKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class ReturnKeywordRecommenderTests + Inherits RecommenderTests Public Sub ReturnInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/SelectKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/SelectKeywordRecommenderTests.vb index 59f7fe3ef2e35..12bff3bedf3d7 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/SelectKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/SelectKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class SelectKeywordRecommenderTests + Inherits RecommenderTests Public Sub SelectInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/StepKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/StepKeywordRecommenderTests.vb index 10a2357ae5da7..01d8d7161d2cb 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/StepKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/StepKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class StepKeywordRecommenderTests + Inherits RecommenderTests + Public Sub StepInForLoopTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/StopKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/StopKeywordRecommenderTests.vb index 2a0354ee162bb..665e163d0c702 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/StopKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/StopKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class StopKeywordRecommenderTests + Inherits RecommenderTests + Public Sub StopInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/SyncLockKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/SyncLockKeywordRecommenderTests.vb index 2a2d5ad27c6e0..f91421123360d 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/SyncLockKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/SyncLockKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class SyncLockKeywordRecommenderTests + Inherits RecommenderTests + Public Sub SyncLockInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ThenKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ThenKeywordRecommenderTests.vb index 4eb69c939db9e..8d51e42039a5c 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ThenKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ThenKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class ThenKeywordRecommenderTests + Inherits RecommenderTests Public Sub NotAfterHashIfTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ThrowKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ThrowKeywordRecommenderTests.vb index 58a92c9a56f29..6f420a1ae3d48 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ThrowKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ThrowKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class ThrowKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ThrowInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ToKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ToKeywordRecommenderTests.vb index 5fb5573e0ad61..0daf731f29a09 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ToKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/ToKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class ToKeywordRecommenderTests + Inherits RecommenderTests + Public Sub ToInCaseStatementTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/TryKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/TryKeywordRecommenderTests.vb index ce1b4340aa32c..fd73fb5908edc 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/TryKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/TryKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class TryKeywordRecommenderTests + Inherits RecommenderTests Public Sub TryInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/UntilAndWhileKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/UntilAndWhileKeywordRecommenderTests.vb index 71118989e496e..f80b03cfaa698 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/UntilAndWhileKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/UntilAndWhileKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class UntilAndWhileKeywordRecommenderTests + Inherits RecommenderTests + Public Sub UntilAfterDoTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WhenKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WhenKeywordRecommenderTests.vb index dd76d71b318c1..5c31a5bc98702 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WhenKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WhenKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class WhenKeywordRecommenderTests + Inherits RecommenderTests + Public Sub WhenAfterCatchBlockTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WhileLoopKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WhileLoopKeywordRecommenderTests.vb index 47208a835a5b6..8377da0beb449 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WhileLoopKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WhileLoopKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class WhileLoopKeywordRecommenderTests + Inherits RecommenderTests Public Sub WhileInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WithKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WithKeywordRecommenderTests.vb index e38f7eb88e812..00ba86edfb52b 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WithKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/WithKeywordRecommenderTests.vb @@ -4,6 +4,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class WithKeywordRecommenderTests + Inherits RecommenderTests + Public Sub WithInMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/YieldKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/YieldKeywordRecommenderTests.vb index 4ed9947af6e01..e2dbd2474f843 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/YieldKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Statements/YieldKeywordRecommenderTests.vb @@ -4,6 +4,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Statements Public Class YieldKeywordRecommenderTests + Inherits RecommenderTests Public Sub InMethodBodyTest() diff --git a/src/EditorFeatures/VisualBasicTest/Recommendations/Types/BuiltInTypesKeywordRecommenderTests.vb b/src/EditorFeatures/VisualBasicTest/Recommendations/Types/BuiltInTypesKeywordRecommenderTests.vb index 58e7c7223f598..aafd9511778f9 100644 --- a/src/EditorFeatures/VisualBasicTest/Recommendations/Types/BuiltInTypesKeywordRecommenderTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Recommendations/Types/BuiltInTypesKeywordRecommenderTests.vb @@ -6,6 +6,8 @@ Imports Microsoft.CodeAnalysis.Completion.Providers Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Types Public Class BuiltInTypesKeywordRecommenderTests + Inherits RecommenderTests + Private ReadOnly _keywordList As String() = { "Boolean", "Byte", diff --git a/src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider.cs b/src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider.cs index 929862c6ba7d0..68120142085bb 100644 --- a/src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider.cs +++ b/src/Features/CSharp/Portable/Completion/CompletionProviders/DeclarationNameCompletionProvider.cs @@ -59,7 +59,7 @@ public override async Task ProvideCompletionsAsync(CompletionContext completionC return; } - var context = CSharpSyntaxContext.CreateContext(document.Project.Solution.Workspace, semanticModel, position, cancellationToken); + var context = CSharpSyntaxContext.CreateContext(document, semanticModel, position, cancellationToken); if (context.IsInNonUserCode) { return; diff --git a/src/Features/CSharp/Portable/Completion/CompletionProviders/ImportCompletion/ImportCompletionProviderHelper.cs b/src/Features/CSharp/Portable/Completion/CompletionProviders/ImportCompletion/ImportCompletionProviderHelper.cs index 0e1ef9c666ead..369f67c642348 100644 --- a/src/Features/CSharp/Portable/Completion/CompletionProviders/ImportCompletion/ImportCompletionProviderHelper.cs +++ b/src/Features/CSharp/Portable/Completion/CompletionProviders/ImportCompletion/ImportCompletionProviderHelper.cs @@ -27,7 +27,7 @@ public static async Task CreateContextAsync(Document document, in // reach outside of the span and ended up with "node not within syntax tree" error from the speculative model. var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); Contract.ThrowIfNull(semanticModel); - return CSharpSyntaxContext.CreateContext(document.Project.Solution.Workspace, semanticModel, position, cancellationToken); + return CSharpSyntaxContext.CreateContext(document, semanticModel, position, cancellationToken); } } } diff --git a/src/Features/CSharp/Portable/Completion/CompletionProviders/OperatorsAndIndexer/UnnamedSymbolCompletionProvider.cs b/src/Features/CSharp/Portable/Completion/CompletionProviders/OperatorsAndIndexer/UnnamedSymbolCompletionProvider.cs index a506979a94dfd..9446f42e90ddb 100644 --- a/src/Features/CSharp/Portable/Completion/CompletionProviders/OperatorsAndIndexer/UnnamedSymbolCompletionProvider.cs +++ b/src/Features/CSharp/Portable/Completion/CompletionProviders/OperatorsAndIndexer/UnnamedSymbolCompletionProvider.cs @@ -107,9 +107,7 @@ public override async Task ProvideCompletionsAsync(CompletionContext context) var position = context.Position; // Escape hatch feature flag to let us disable this feature remotely if we run into any issues with it, - var workspace = document.Project.Solution.Workspace; - var disabled = context.Options.GetOption(CompletionOptions.UnnamedSymbolCompletionDisabledFeatureFlag); - if (disabled) + if (context.Options.GetOption(CompletionOptions.UnnamedSymbolCompletionDisabledFeatureFlag)) return; var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); @@ -122,7 +120,7 @@ public override async Task ProvideCompletionsAsync(CompletionContext context) var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); var options = CodeAnalysis.Completion.Providers.CompletionUtilities.GetUpdatedRecommendationOptions(context.Options, document.Project.Language); - var recommendedSymbols = recommender.GetRecommendedSymbolsAtPosition(workspace, semanticModel, position, options, cancellationToken); + var recommendedSymbols = recommender.GetRecommendedSymbolsAtPosition(document, semanticModel, position, options, cancellationToken); AddUnnamedSymbols(context, position, semanticModel, recommendedSymbols.UnnamedSymbols, cancellationToken); } diff --git a/src/Features/CSharp/Portable/Completion/CompletionProviders/TupleNameCompletionProvider.cs b/src/Features/CSharp/Portable/Completion/CompletionProviders/TupleNameCompletionProvider.cs index c7447e061956b..6725c8a5c4bcb 100644 --- a/src/Features/CSharp/Portable/Completion/CompletionProviders/TupleNameCompletionProvider.cs +++ b/src/Features/CSharp/Portable/Completion/CompletionProviders/TupleNameCompletionProvider.cs @@ -46,8 +46,7 @@ public override async Task ProvideCompletionsAsync(CompletionContext completionC var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false); - var workspace = document.Project.Solution.Workspace; - var context = CSharpSyntaxContext.CreateContext(workspace, semanticModel, position, cancellationToken); + var context = CSharpSyntaxContext.CreateContext(document, semanticModel, position, cancellationToken); var index = GetElementIndex(context); if (index == null) diff --git a/src/Features/Core/Portable/ChangeSignature/AbstractChangeSignatureService.cs b/src/Features/Core/Portable/ChangeSignature/AbstractChangeSignatureService.cs index dabab4bd296c8..53abdd7660922 100644 --- a/src/Features/Core/Portable/ChangeSignature/AbstractChangeSignatureService.cs +++ b/src/Features/Core/Portable/ChangeSignature/AbstractChangeSignatureService.cs @@ -908,7 +908,8 @@ private async Task GenerateInferredCallsiteExpressionAsync( } var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); - var recommendations = await Recommender.GetRecommendedSymbolsAtPositionAsync(semanticModel, position, document.Project.Solution.Workspace, options: null, cancellationToken).ConfigureAwait(false); + var recommender = document.GetRequiredLanguageService(); + var recommendations = recommender.GetRecommendedSymbolsAtPosition(document, semanticModel, position, document.Project.Solution.Options, cancellationToken).NamedSymbols; var sourceSymbols = recommendations.Where(r => r.IsNonImplicitAndFromSource()); diff --git a/src/Features/Core/Portable/Completion/Providers/AbstractAwaitCompletionProvider.cs b/src/Features/Core/Portable/Completion/Providers/AbstractAwaitCompletionProvider.cs index a02284e842dc6..5f76e2d450eb1 100644 --- a/src/Features/Core/Portable/Completion/Providers/AbstractAwaitCompletionProvider.cs +++ b/src/Features/Core/Portable/Completion/Providers/AbstractAwaitCompletionProvider.cs @@ -41,8 +41,7 @@ public sealed override async Task ProvideCompletionsAsync(CompletionContext cont } var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false); - var workspace = document.Project.Solution.Workspace; - var syntaxContext = document.GetRequiredLanguageService().CreateContext(workspace, semanticModel, position, cancellationToken); + var syntaxContext = document.GetRequiredLanguageService().CreateContext(document, semanticModel, position, cancellationToken); if (!syntaxContext.IsAwaitKeywordContext()) { return; diff --git a/src/Features/Core/Portable/Completion/Providers/AbstractKeywordCompletionProvider.cs b/src/Features/Core/Portable/Completion/Providers/AbstractKeywordCompletionProvider.cs index df381ff9e1d60..df0f01226be69 100644 --- a/src/Features/Core/Portable/Completion/Providers/AbstractKeywordCompletionProvider.cs +++ b/src/Features/Core/Portable/Completion/Providers/AbstractKeywordCompletionProvider.cs @@ -44,7 +44,7 @@ private async Task> RecommendCompletionItemsAsync { var syntaxContextService = document.GetRequiredLanguageService(); var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false); - var syntaxContext = (TContext)syntaxContextService.CreateContext(document.Project.Solution.Workspace, semanticModel, position, cancellationToken); + var syntaxContext = (TContext)syntaxContextService.CreateContext(document, semanticModel, position, cancellationToken); var keywords = await RecommendKeywordsAsync(document, position, syntaxContext, cancellationToken).ConfigureAwait(false); return keywords.SelectAsArray(k => CreateItem(k, syntaxContext, cancellationToken)); } diff --git a/src/Features/Core/Portable/Completion/Providers/AbstractPartialTypeCompletionProvider.cs b/src/Features/Core/Portable/Completion/Providers/AbstractPartialTypeCompletionProvider.cs index 9bae28890fa0f..24adae052dbbe 100644 --- a/src/Features/Core/Portable/Completion/Providers/AbstractPartialTypeCompletionProvider.cs +++ b/src/Features/Core/Portable/Completion/Providers/AbstractPartialTypeCompletionProvider.cs @@ -42,7 +42,7 @@ public sealed override async Task ProvideCompletionsAsync(CompletionContext comp if (semanticModel.GetDeclaredSymbol(node, cancellationToken) is INamedTypeSymbol declaredSymbol) { var syntaxContextService = document.GetRequiredLanguageService(); - var syntaxContext = (TSyntaxContext)syntaxContextService.CreateContext(document.Project.Solution.Workspace, semanticModel, position, cancellationToken); + var syntaxContext = (TSyntaxContext)syntaxContextService.CreateContext(document, semanticModel, position, cancellationToken); var symbols = LookupCandidateSymbols(syntaxContext, declaredSymbol, cancellationToken); var items = symbols?.Select(s => CreateCompletionItem(s, syntaxContext)); diff --git a/src/Features/Core/Portable/Completion/Providers/AbstractPreprocessorCompletionProvider.cs b/src/Features/Core/Portable/Completion/Providers/AbstractPreprocessorCompletionProvider.cs index 1106336ce1d58..c1e64e5635016 100644 --- a/src/Features/Core/Portable/Completion/Providers/AbstractPreprocessorCompletionProvider.cs +++ b/src/Features/Core/Portable/Completion/Providers/AbstractPreprocessorCompletionProvider.cs @@ -24,7 +24,7 @@ public sealed override async Task ProvideCompletionsAsync(CompletionContext cont var semanticModel = await originatingDocument.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false); var service = originatingDocument.GetRequiredLanguageService(); var solution = originatingDocument.Project.Solution; - var syntaxContext = service.CreateContext(solution.Workspace, semanticModel, position, cancellationToken); + var syntaxContext = service.CreateContext(originatingDocument, semanticModel, position, cancellationToken); if (!syntaxContext.IsPreProcessorExpressionContext) return; diff --git a/src/Features/Core/Portable/Completion/Providers/AbstractRecommendationServiceBasedCompletionProvider.cs b/src/Features/Core/Portable/Completion/Providers/AbstractRecommendationServiceBasedCompletionProvider.cs index 134bf4e78e1e2..8b2b2bb28752e 100644 --- a/src/Features/Core/Portable/Completion/Providers/AbstractRecommendationServiceBasedCompletionProvider.cs +++ b/src/Features/Core/Portable/Completion/Providers/AbstractRecommendationServiceBasedCompletionProvider.cs @@ -32,7 +32,7 @@ internal abstract class AbstractRecommendationServiceBasedCompletionProvider(); - var recommendedSymbols = recommender.GetRecommendedSymbolsAtPosition(context.Workspace, context.SemanticModel, position, options, cancellationToken); + var recommendedSymbols = recommender.GetRecommendedSymbolsAtPosition(context.Document, context.SemanticModel, position, options, cancellationToken); var shouldPreselectInferredTypes = await ShouldPreselectInferredTypesAsync(completionContext, position, options, cancellationToken).ConfigureAwait(false); if (!shouldPreselectInferredTypes) diff --git a/src/Features/Core/Portable/Completion/Providers/AbstractSymbolCompletionProvider.cs b/src/Features/Core/Portable/Completion/Providers/AbstractSymbolCompletionProvider.cs index 45ac53430316e..6475646756280 100644 --- a/src/Features/Core/Portable/Completion/Providers/AbstractSymbolCompletionProvider.cs +++ b/src/Features/Core/Portable/Completion/Providers/AbstractSymbolCompletionProvider.cs @@ -202,7 +202,7 @@ private CompletionItem CreateItem( } if (invalidProjects != null) - supportedPlatformData = new SupportedPlatformData(invalidProjects, totalProjects, context.Workspace); + supportedPlatformData = new SupportedPlatformData(completionContext.Document.Project.Solution, invalidProjects, totalProjects); } return CreateItem( @@ -381,11 +381,10 @@ protected virtual Task IsSemanticTriggerCharacterAsync(Document document, protected static async Task CreateContextAsync(Document document, int position, CancellationToken cancellationToken) { - var workspace = document.Project.Solution.Workspace; var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false); var service = document.GetRequiredLanguageService(); - return (TSyntaxContext)service.CreateContext(workspace, semanticModel, position, cancellationToken); + return (TSyntaxContext)service.CreateContext(document, semanticModel, position, cancellationToken); } private static Task GetOrCreateContextAsync(Document document, int position, CancellationToken cancellationToken) diff --git a/src/Features/Core/Portable/Completion/Providers/IKeywordRecommender.cs b/src/Features/Core/Portable/Completion/Providers/IKeywordRecommender.cs index 563c523150415..dec8955c35379 100644 --- a/src/Features/Core/Portable/Completion/Providers/IKeywordRecommender.cs +++ b/src/Features/Core/Portable/Completion/Providers/IKeywordRecommender.cs @@ -4,10 +4,12 @@ using System.Collections.Immutable; using System.Threading; +using Microsoft.CodeAnalysis.Shared.Extensions.ContextQuery; namespace Microsoft.CodeAnalysis.Completion.Providers { internal interface IKeywordRecommender + where TContext : SyntaxContext { ImmutableArray RecommendKeywords(int position, TContext context, CancellationToken cancellationToken); } diff --git a/src/Features/Core/Portable/Completion/Providers/SymbolCompletionItem.cs b/src/Features/Core/Portable/Completion/Providers/SymbolCompletionItem.cs index efc1b5bdec458..72e47a67f2cc6 100644 --- a/src/Features/Core/Portable/Completion/Providers/SymbolCompletionItem.cs +++ b/src/Features/Core/Portable/Completion/Providers/SymbolCompletionItem.cs @@ -20,6 +20,7 @@ internal static partial class SymbolCompletionItem { private static readonly Func, CompletionItem, CompletionItem> s_addSymbolEncoding = AddSymbolEncoding; private static readonly Func, CompletionItem, CompletionItem> s_addSymbolInfo = AddSymbolInfo; + private static readonly char[] s_projectSeperators = new[] { ';' }; private static CompletionItem CreateWorker( string displayText, @@ -187,12 +188,11 @@ public static async Task GetDescriptionForSymbolsAsync( if (position == -1) position = item.Span.Start; - var workspace = document.Project.Solution.Workspace; - - var supportedPlatforms = GetSupportedPlatforms(item, workspace); + var supportedPlatforms = GetSupportedPlatforms(item, document.Project.Solution); var contextDocument = FindAppropriateDocumentForDescriptionContext(document, supportedPlatforms); var semanticModel = await contextDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); + var workspace = document.Project.Solution.Workspace; return await CommonCompletionUtilities.CreateDescriptionAsync(workspace, semanticModel, position, symbols, supportedPlatforms, cancellationToken).ConfigureAwait(false); } @@ -225,16 +225,15 @@ private static CompletionItem WithSupportedPlatforms(CompletionItem completionIt } } - private static readonly char[] projectSeperators = new[] { ';' }; - public static SupportedPlatformData GetSupportedPlatforms(CompletionItem item, Workspace workspace) + public static SupportedPlatformData GetSupportedPlatforms(CompletionItem item, Solution solution) { if (item.Properties.TryGetValue("InvalidProjects", out var invalidProjects) && item.Properties.TryGetValue("CandidateProjects", out var candidateProjects)) { return new SupportedPlatformData( - invalidProjects.Split(projectSeperators).Select(s => ProjectId.CreateFromSerialized(Guid.Parse(s))).ToList(), - candidateProjects.Split(projectSeperators).Select(s => ProjectId.CreateFromSerialized(Guid.Parse(s))).ToList(), - workspace); + solution, + invalidProjects.Split(s_projectSeperators).Select(s => ProjectId.CreateFromSerialized(Guid.Parse(s))).ToList(), + candidateProjects.Split(s_projectSeperators).Select(s => ProjectId.CreateFromSerialized(Guid.Parse(s))).ToList()); } return null; @@ -354,14 +353,12 @@ internal static bool GetSymbolIsGeneric(CompletionItem item) public static async Task GetDescriptionAsync( CompletionItem item, IReadOnlyList symbols, Document document, SemanticModel semanticModel, CancellationToken cancellationToken) { - var workspace = document.Project.Solution.Workspace; - var position = GetDescriptionPosition(item); - var supportedPlatforms = GetSupportedPlatforms(item, workspace); + var supportedPlatforms = GetSupportedPlatforms(item, document.Project.Solution); if (symbols.Count != 0) { - return await CommonCompletionUtilities.CreateDescriptionAsync(workspace, semanticModel, position, symbols, supportedPlatforms, cancellationToken).ConfigureAwait(false); + return await CommonCompletionUtilities.CreateDescriptionAsync(document.Project.Solution.Workspace, semanticModel, position, symbols, supportedPlatforms, cancellationToken).ConfigureAwait(false); } else { diff --git a/src/Features/Core/Portable/Diagnostics/DefaultDiagnosticModeServiceFactory.cs b/src/Features/Core/Portable/Diagnostics/DefaultDiagnosticModeServiceFactory.cs deleted file mode 100644 index 758842d5c5651..0000000000000 --- a/src/Features/Core/Portable/Diagnostics/DefaultDiagnosticModeServiceFactory.cs +++ /dev/null @@ -1,85 +0,0 @@ -// 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; -using System.Collections.Generic; -using System.Composition; -using Microsoft.CodeAnalysis.Host; -using Microsoft.CodeAnalysis.Host.Mef; -using Microsoft.CodeAnalysis.Options; - -namespace Microsoft.CodeAnalysis.Diagnostics -{ - [ExportWorkspaceServiceFactory(typeof(IDiagnosticModeService), ServiceLayer.Default), Shared] - internal class DefaultDiagnosticModeServiceFactory : IWorkspaceServiceFactory - { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public DefaultDiagnosticModeServiceFactory() - { - } - - public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices) - => new DefaultDiagnosticModeService(workspaceServices.Workspace); - - private class DefaultDiagnosticModeService : IDiagnosticModeService - { - private readonly Workspace _workspace; - private readonly Dictionary, Lazy> _optionToMode = new(); - - public DefaultDiagnosticModeService(Workspace workspace) - { - _workspace = workspace; - } - - public DiagnosticMode GetDiagnosticMode(Option2 option) - { - var lazy = GetLazy(option); - return lazy.Value; - } - - private Lazy GetLazy(Option2 option) - { - lock (_optionToMode) - { - if (!_optionToMode.TryGetValue(option, out var lazy)) - { - lazy = new Lazy(() => ComputeDiagnosticMode(option), isThreadSafe: true); - _optionToMode.Add(option, lazy); - } - - return lazy; - } - } - - private DiagnosticMode ComputeDiagnosticMode(Option2 option) - { - var inCodeSpacesServer = IsInCodeSpacesServer(); - - // If we're in the code-spaces server, we only support pull diagnostics. This is because the only way - // for diagnostics to make it through from the server to the client is through the codespaces LSP - // channel, which is only pull based. - if (inCodeSpacesServer) - return DiagnosticMode.Pull; - - var diagnosticModeOption = _workspace.Options.GetOption(option); - - // If the workspace diagnostic mode is set to Default, defer to the feature flag service. - if (diagnosticModeOption == DiagnosticMode.Default) - { - return _workspace.Options.GetOption(DiagnosticOptions.LspPullDiagnosticsFeatureFlag) ? DiagnosticMode.Pull : DiagnosticMode.Push; - } - - // Otherwise, defer to the workspace+option to determine what mode we're in. - return diagnosticModeOption; - } - - private static bool IsInCodeSpacesServer() - { - // hack until there is an officially supported free-threaded synchronous platform API to ask this question. - return Environment.GetEnvironmentVariable("VisualStudioServerMode") == "1"; - } - } - } -} diff --git a/src/Features/Core/Portable/Diagnostics/DiagnosticModeExtensions.cs b/src/Features/Core/Portable/Diagnostics/DiagnosticModeExtensions.cs new file mode 100644 index 0000000000000..23ef50921674b --- /dev/null +++ b/src/Features/Core/Portable/Diagnostics/DiagnosticModeExtensions.cs @@ -0,0 +1,32 @@ +// 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 Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Options; + +namespace Microsoft.CodeAnalysis.Diagnostics +{ + internal static class DiagnosticModeExtensions + { + private static DiagnosticMode GetDiagnosticMode(Workspace workspace, Option2 option) + { + var diagnosticModeOption = workspace.Options.GetOption(option); + + // If the workspace diagnostic mode is set to Default, defer to the feature flag service. + if (diagnosticModeOption == DiagnosticMode.Default) + { + return workspace.Options.GetOption(DiagnosticOptions.LspPullDiagnosticsFeatureFlag) ? DiagnosticMode.Pull : DiagnosticMode.Push; + } + + // Otherwise, defer to the workspace+option to determine what mode we're in. + return diagnosticModeOption; + } + + public static bool IsPullDiagnostics(this Workspace workspace, Option2 option) + => GetDiagnosticMode(workspace, option) == DiagnosticMode.Pull; + + public static bool IsPushDiagnostics(this Workspace workspace, Option2 option) + => GetDiagnosticMode(workspace, option) == DiagnosticMode.Push; + } +} diff --git a/src/Features/Core/Portable/Diagnostics/IDiagnosticModeService.cs b/src/Features/Core/Portable/Diagnostics/IDiagnosticModeService.cs deleted file mode 100644 index 473a6a3d6cfaa..0000000000000 --- a/src/Features/Core/Portable/Diagnostics/IDiagnosticModeService.cs +++ /dev/null @@ -1,39 +0,0 @@ -// 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 Microsoft.CodeAnalysis.Host; -using Microsoft.CodeAnalysis.Options; - -namespace Microsoft.CodeAnalysis.Diagnostics -{ - /// - /// Service exposed to determine what diagnostic mode a workspace is in. Exposed in this fashion so that individual - /// workspaces can override that value based on other factors. - /// - internal interface IDiagnosticModeService : IWorkspaceService - { - DiagnosticMode GetDiagnosticMode(Option2 diagnosticMode); - } - - internal static class DiagnosticModeExtensions - { - public static DiagnosticMode GetDiagnosticMode(this Workspace workspace, Option2 option) - { - var service = workspace.Services.GetRequiredService(); - return service.GetDiagnosticMode(option); - } - - public static bool IsPullDiagnostics(this Workspace workspace, Option2 option) - { - var mode = GetDiagnosticMode(workspace, option); - return mode == DiagnosticMode.Pull; - } - - public static bool IsPushDiagnostics(this Workspace workspace, Option2 option) - { - var mode = GetDiagnosticMode(workspace, option); - return mode == DiagnosticMode.Push; - } - } -} diff --git a/src/Features/Core/Portable/QuickInfo/CommonSemanticQuickInfoProvider.cs b/src/Features/Core/Portable/QuickInfo/CommonSemanticQuickInfoProvider.cs index 61b21dfa2d5e9..e4d17c7580826 100644 --- a/src/Features/Core/Portable/QuickInfo/CommonSemanticQuickInfoProvider.cs +++ b/src/Features/Core/Portable/QuickInfo/CommonSemanticQuickInfoProvider.cs @@ -122,7 +122,7 @@ internal abstract partial class CommonSemanticQuickInfoProvider : CommonQuickInf invalidProjects.Add(docId.ProjectId); } - var supportedPlatforms = new SupportedPlatformData(invalidProjects, candidateProjects, workspace); + var supportedPlatforms = new SupportedPlatformData(solution, invalidProjects, candidateProjects); return (bestBinding.tokenInformation, supportedPlatforms); } diff --git a/src/Features/Core/Portable/Shared/Utilities/SupportedPlatformData.cs b/src/Features/Core/Portable/Shared/Utilities/SupportedPlatformData.cs index a796b77b9cf87..a6b7a2107976f 100644 --- a/src/Features/Core/Portable/Shared/Utilities/SupportedPlatformData.cs +++ b/src/Features/Core/Portable/Shared/Utilities/SupportedPlatformData.cs @@ -11,20 +11,20 @@ namespace Microsoft.CodeAnalysis.Shared.Utilities { - internal class SupportedPlatformData + internal sealed class SupportedPlatformData { // Because completion finds lots of symbols that exist in // all projects, we'll instead maintain a list of projects // missing the symbol. public readonly List InvalidProjects; public readonly IEnumerable CandidateProjects; - public readonly Workspace Workspace; + public readonly Solution Solution; - public SupportedPlatformData(List invalidProjects, IEnumerable candidateProjects, Workspace workspace) + public SupportedPlatformData(Solution solution, List invalidProjects, IEnumerable candidateProjects) { InvalidProjects = invalidProjects; CandidateProjects = candidateProjects; - Workspace = workspace; + Solution = solution; } public IList ToDisplayParts() @@ -37,7 +37,7 @@ public IList ToDisplayParts() var builder = new List(); builder.AddLineBreak(); - var projects = CandidateProjects.Select(p => Workspace.CurrentSolution.GetProject(p)).OrderBy(p => p.Name); + var projects = CandidateProjects.Select(p => Solution.GetRequiredProject(p)).OrderBy(p => p.Name); foreach (var project in projects) { var text = string.Format(FeaturesResources._0_1, project.Name, Supported(!InvalidProjects.Contains(project.Id))); diff --git a/src/Features/Core/Portable/SignatureHelp/AbstractSignatureHelpProvider.cs b/src/Features/Core/Portable/SignatureHelp/AbstractSignatureHelpProvider.cs index 994fe50b2e833..567d651e1ce7d 100644 --- a/src/Features/Core/Portable/SignatureHelp/AbstractSignatureHelpProvider.cs +++ b/src/Features/Core/Portable/SignatureHelp/AbstractSignatureHelpProvider.cs @@ -302,7 +302,7 @@ symbolKeyItem.SymbolKey is not SymbolKey symbolKey || } } - var platformData = new SupportedPlatformData(invalidProjectsForCurrentSymbol, totalProjects, document.Project.Solution.Workspace); + var platformData = new SupportedPlatformData(document.Project.Solution, invalidProjectsForCurrentSymbol, totalProjects); finalItems.Add(UpdateItem(item, platformData)); } diff --git a/src/Features/VisualBasic/Portable/Completion/CompletionProviders/ImportCompletionProvider/ImportCompletionProviderHelper.vb b/src/Features/VisualBasic/Portable/Completion/CompletionProviders/ImportCompletionProvider/ImportCompletionProviderHelper.vb index 045619b6e0243..d3d346e1aab02 100644 --- a/src/Features/VisualBasic/Portable/Completion/CompletionProviders/ImportCompletionProvider/ImportCompletionProviderHelper.vb +++ b/src/Features/VisualBasic/Portable/Completion/CompletionProviders/ImportCompletionProvider/ImportCompletionProviderHelper.vb @@ -35,7 +35,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers ' reach outside of the span And ended up with "node not within syntax tree" error from the speculative model. Dim semanticModel = (Await document.GetPartialSemanticModelAsync(cancellationToken).ConfigureAwait(False)).semanticModel Contract.ThrowIfNull(semanticModel) - Return VisualBasicSyntaxContext.CreateContext(document.Project.Solution.Workspace, semanticModel, position, cancellationToken) + Return VisualBasicSyntaxContext.CreateContext(document, semanticModel, position, cancellationToken) End Function End Class End Namespace diff --git a/src/Features/VisualBasic/Portable/Completion/KeywordRecommenders/Expressions/TrueFalseKeywordRecommender.vb b/src/Features/VisualBasic/Portable/Completion/KeywordRecommenders/Expressions/TrueFalseKeywordRecommender.vb index fb00a3a1a85a2..6e46d663df6c3 100644 --- a/src/Features/VisualBasic/Portable/Completion/KeywordRecommenders/Expressions/TrueFalseKeywordRecommender.vb +++ b/src/Features/VisualBasic/Portable/Completion/KeywordRecommenders/Expressions/TrueFalseKeywordRecommender.vb @@ -29,15 +29,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.KeywordRecommenders.Expr End Function Private Shared Function ShouldPreselect(context As VisualBasicSyntaxContext, cancellationToken As CancellationToken) As Boolean - ' The Workspace might be null in the keyword recommender tests, since we don't create one for those. - ' This function still gets test coverage through the all-up completion tests. - Dim document = context.Workspace?.CurrentSolution.GetDocument(context.SyntaxTree) - - If document Is Nothing Then - Return False - End If - - Dim typeInferenceService = document.GetLanguageService(Of ITypeInferenceService)() + Dim typeInferenceService = context.Document.GetLanguageService(Of ITypeInferenceService)() Contract.ThrowIfNull(typeInferenceService, NameOf(typeInferenceService)) Dim types = typeInferenceService.InferTypes(context.SemanticModel, context.Position, cancellationToken) diff --git a/src/VisualStudio/Core/Def/Implementation/Watson/WatsonReporter.cs b/src/VisualStudio/Core/Def/Implementation/Watson/WatsonReporter.cs index 369697d2f1f2f..135f427c4873a 100644 --- a/src/VisualStudio/Core/Def/Implementation/Watson/WatsonReporter.cs +++ b/src/VisualStudio/Core/Def/Implementation/Watson/WatsonReporter.cs @@ -196,11 +196,6 @@ private static List CollectServiceHubLogFilePaths() // filter logs that are not relevant to Roslyn investigation if (!name.Contains("-" + ServiceDescriptors.ServiceNameTopLevelPrefix) && !name.Contains("-" + RemoteServiceName.Prefix) && - !name.Contains("-" + RemoteServiceName.IntelliCodeServiceName) && - !name.Contains("-" + RemoteServiceName.RazorServiceName) && - !name.Contains("-" + RemoteServiceName.UnitTestingAnalysisServiceName) && - !name.Contains("-" + RemoteServiceName.LiveUnitTestingBuildServiceName) && - !name.Contains("-" + RemoteServiceName.UnitTestingSourceLookupServiceName) && !name.Contains("-CodeLens") && !name.Contains("-ManagedLanguage.IDE.RemoteHostClient") && !name.Contains("-hub")) diff --git a/src/Workspaces/CSharp/Portable/Recommendations/CSharpRecommendationService.cs b/src/Workspaces/CSharp/Portable/Recommendations/CSharpRecommendationService.cs index 039afbee12bf5..5ae11cd5d0be0 100644 --- a/src/Workspaces/CSharp/Portable/Recommendations/CSharpRecommendationService.cs +++ b/src/Workspaces/CSharp/Portable/Recommendations/CSharpRecommendationService.cs @@ -20,8 +20,8 @@ public CSharpRecommendationService() { } - protected override CSharpSyntaxContext CreateContext(Workspace workspace, SemanticModel semanticModel, int position, CancellationToken cancellationToken) - => CSharpSyntaxContext.CreateContext(workspace, semanticModel, position, cancellationToken); + protected override CSharpSyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) + => CSharpSyntaxContext.CreateContext(document, semanticModel, position, cancellationToken); protected override AbstractRecommendationServiceRunner CreateRunner(CSharpSyntaxContext context, bool filterOutOfScopeLocals, CancellationToken cancellationToken) => new CSharpRecommendationServiceRunner(context, filterOutOfScopeLocals, cancellationToken); diff --git a/src/Workspaces/Core/Portable/ExternalAccess/Pythia/Api/PythiaRemoteHostClient.cs b/src/Workspaces/Core/Portable/ExternalAccess/Pythia/Api/PythiaRemoteHostClient.cs deleted file mode 100644 index 6f99f7b3987bd..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/Pythia/Api/PythiaRemoteHostClient.cs +++ /dev/null @@ -1,34 +0,0 @@ -// 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; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Remote; -using Roslyn.Utilities; - -namespace Microsoft.CodeAnalysis.ExternalAccess.Pythia.Api -{ - [Obsolete] - internal static class PythiaRemoteHostClient - { - public static Task> TryRunRemoteAsync(Workspace workspace, string serviceName, string targetName, Solution? solution, IReadOnlyList arguments, CancellationToken cancellationToken) - { - Contract.ThrowIfFalse(serviceName == "pythia"); - return TryRunRemoteAsync(workspace, targetName, solution, arguments, cancellationToken); - } - - public static async Task> TryRunRemoteAsync(Workspace workspace, string targetName, Solution? solution, IReadOnlyList arguments, CancellationToken cancellationToken) - { - var client = await RemoteHostClient.TryGetClientAsync(workspace, cancellationToken).ConfigureAwait(false); - if (client == null) - { - return default; - } - - return await client.RunRemoteAsync(WellKnownServiceHubService.IntelliCode, targetName, solution, arguments, callbackTarget: null, cancellationToken).ConfigureAwait(false); - } - } -} diff --git a/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj b/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj index 6f178a9b95c31..966efc2b42127 100644 --- a/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj +++ b/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj @@ -38,6 +38,7 @@ + @@ -78,6 +79,7 @@ +