diff --git a/src/EditorFeatures/CSharpTest/Recommendations/BoolKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/BoolKeywordRecommenderTests.cs index a810df13a796366d5e30b1a81f787253937e7cef..10087f2724036ea06e545b4af2eae808d8e11e3e 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/BoolKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/BoolKeywordRecommenderTests.cs @@ -600,5 +600,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/ByteKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/ByteKeywordRecommenderTests.cs index 165b0920b09e4ff1cfcaa731c08d4a84eed60ab0..7a2e7b4e1f3e92e369a2bc80061570282930698e 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/ByteKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/ByteKeywordRecommenderTests.cs @@ -600,5 +600,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/CharKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/CharKeywordRecommenderTests.cs index e1c8a51dcd2305b5c6c10d26e1a97497b6b7094f..67ee5986da6b5708ae4e7a15d0b022dc10a77712 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/CharKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/CharKeywordRecommenderTests.cs @@ -652,5 +652,16 @@ static void Main(string[] args) "; VerifyKeyword(markup); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/DecimalKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/DecimalKeywordRecommenderTests.cs index 84ea185ab1718f5c3345a3463581f817c49d4bfd..a41cfa6f8eaacf0ac41ca6a88de8af9d691d857a 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/DecimalKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/DecimalKeywordRecommenderTests.cs @@ -601,5 +601,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/DoubleKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/DoubleKeywordRecommenderTests.cs index 6931e2100d2de7c4df35f6fe3b4c57825bd643c8..68614ceca17a2a01694df7852b0c781e9cd7caa0 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/DoubleKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/DoubleKeywordRecommenderTests.cs @@ -600,5 +600,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/FloatKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/FloatKeywordRecommenderTests.cs index 122178e71fdaa52beb0dcacf2f4f75f2d21d2f35..1b2a412a9b658deacca897fa2cb1f99bccb6a3d9 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/FloatKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/FloatKeywordRecommenderTests.cs @@ -573,5 +573,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/IntKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/IntKeywordRecommenderTests.cs index a3d4ec938d8f9fe55e63c6311981d04062c5b5da..ab3a2f3b5ecabec8ca8a7a25f24b4c2759117f8f 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/IntKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/IntKeywordRecommenderTests.cs @@ -669,5 +669,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/LongKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/LongKeywordRecommenderTests.cs index bce7aa6b47ba908ef92594cbcef10cae335ce137..0e1ac6ad32654462a5b69abcdc274cbca1ea3e1e 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/LongKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/LongKeywordRecommenderTests.cs @@ -600,5 +600,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/ObjectKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/ObjectKeywordRecommenderTests.cs index c8d26b2ac2d3fdab3b7f9f8ce4b701787c0c8971..5d17a1c34cd86067d45390f2e5b509e2c7a438d6 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/ObjectKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/ObjectKeywordRecommenderTests.cs @@ -607,5 +607,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/SByteKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/SByteKeywordRecommenderTests.cs index 2b07994442cd6704ee684589d397c5574c72288d..f0665835db76b2aa3e693141dfe1b3f2c1f7a2c0 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/SByteKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/SByteKeywordRecommenderTests.cs @@ -600,5 +600,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/ShortKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/ShortKeywordRecommenderTests.cs index ea5286ae79012d7cdc27948db4407dad5d120196..eb4f257c93058fd5994302a7d7c6cd278c776ead 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/ShortKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/ShortKeywordRecommenderTests.cs @@ -593,5 +593,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/StringKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/StringKeywordRecommenderTests.cs index d55d864963e9ba48046ea41ed395cc43896be81a..6a7a791d53eed405ac422c7cb783a841f1501c9a 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/StringKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/StringKeywordRecommenderTests.cs @@ -649,5 +649,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/UIntKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/UIntKeywordRecommenderTests.cs index 95c954e37346418ed88e4ac7be051d7298843ed4..81935f4ed32fd063570454f3ae30661c5d021466 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/UIntKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/UIntKeywordRecommenderTests.cs @@ -600,5 +600,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/ULongKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/ULongKeywordRecommenderTests.cs index 3d865b7af9e71eed999cf9d18beabb97144e37a7..4377e0b1c45f7b7c381e8a925b4d8c5dba458811 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/ULongKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/ULongKeywordRecommenderTests.cs @@ -600,5 +600,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/Recommendations/UShortKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest/Recommendations/UShortKeywordRecommenderTests.cs index 5daaa408a0152f371cdd8d13a146b24c7d256b5e..8edb908d323617222c8252af2f5a9a1741a869db 100644 --- a/src/EditorFeatures/CSharpTest/Recommendations/UShortKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest/Recommendations/UShortKeywordRecommenderTests.cs @@ -600,5 +600,16 @@ public void NotAfterAsyncAsType() { VerifyAbsence(@"class c { async async $$ }"); } + + [WorkItem(1468, "https://github.com/dotnet/roslyn/issues/1468")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public void NotInCrefTypeParameter() + { + VerifyAbsence(@" +using System; +/// +class C { } +"); + } } } diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/BoolKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/BoolKeywordRecommender.cs index 2180a50d95f14a7dcfa2d3e91950fa008c0b0c7e..c75e637e49ac72a482ddc4acd03afbe9c7b49cb0 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/BoolKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/BoolKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || context.IsFixedVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/ByteKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/ByteKeywordRecommender.cs index da29ea8c27ec464d5271c835dfc5410f1eb06aec..0c713a763b452ebd48903a01488c3204dfa0786e 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/ByteKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/ByteKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -24,7 +26,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsEnumBaseListContext || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/CharKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/CharKeywordRecommender.cs index 02493f55deec406375049c66a5905dbb517b35be..d548494affd3e30b1a8ee6d865ce51dfbe551138 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/CharKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/CharKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || context.IsFixedVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/DecimalKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/DecimalKeywordRecommender.cs index d35c61e0f1cc373d2761a56014319f9b773ee4ba..e0f5ed2da4f3c28b6e902c1eaaa3a2ca53deb09c 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/DecimalKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/DecimalKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || context.IsFixedVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/DoubleKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/DoubleKeywordRecommender.cs index 0fcc79f03c8cf7882e93f4516e7ab6c55bf874d0..00c32c1a50b2e00dbd8c628cfdc25fe3b53f47da 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/DoubleKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/DoubleKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || context.IsFixedVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/FloatKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/FloatKeywordRecommender.cs index 148772358083174827431ecf9adaf286db1bf356..a159e6ec832c550235e57f72d1d55b7732f0ed16 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/FloatKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/FloatKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || context.IsFixedVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/IntKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/IntKeywordRecommender.cs index 7f8aac1abf125289a87b6312fb5a32f7e3aa9c27..b853d3de58f583cd4840ad56aa9d6a9a04f42d37 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/IntKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/IntKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsEnumBaseListContext || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/LongKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/LongKeywordRecommender.cs index 74b692fc3ba1039709880df41c581bbf8c01ce92..cace23400a04e389f170ad266c6112e062c8f60c 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/LongKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/LongKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsEnumBaseListContext || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/ObjectKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/ObjectKeywordRecommender.cs index 8846960ee379d605c0d914b9891a395c2c3a034d..1f195349703178a1467130094e44e129ff5df0fc 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/ObjectKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/ObjectKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || context.IsParameterTypeContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/SByteKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/SByteKeywordRecommender.cs index f54864c368e423d67f2411ed14bcb99a4aaed590..1b4b39b2ed19d27ecf3dabc1c0e0270a477e81ca 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/SByteKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/SByteKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsEnumBaseListContext || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/ShortKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/ShortKeywordRecommender.cs index 705afa0efc38bb6d050f39655111e931c6907702..1cfbf868c67177503fcc98969c59f73ee797bb90 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/ShortKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/ShortKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsEnumBaseListContext || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/StringKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/StringKeywordRecommender.cs index 88bac537f84e128f5b50f3ff31f0c6cf93a9eded..d7ed9f1c45155462ada832a9bc1b38d0ef8ed992 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/StringKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/StringKeywordRecommender.cs @@ -1,9 +1,11 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || context.IsParameterTypeContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/UIntKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/UIntKeywordRecommender.cs index 283bab9c48f0c765d2c14394f8e9a66612994779..21a6812774828e97a47de9ce13df8979736affd9 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/UIntKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/UIntKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsEnumBaseListContext || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/ULongKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/ULongKeywordRecommender.cs index d98b4250437740853c6a6296d2c792d3c44415ea..b741704b37ca51ca6ae52b9b1a9765be0570ff65 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/ULongKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/ULongKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsEnumBaseListContext || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext || diff --git a/src/Features/CSharp/Completion/KeywordRecommenders/UShortKeywordRecommender.cs b/src/Features/CSharp/Completion/KeywordRecommenders/UShortKeywordRecommender.cs index 858831c322603baf5a4ec56e33660f5b444fcbab..a95d2c2f85c1a754a2a43a0300d789fe1732276d 100644 --- a/src/Features/CSharp/Completion/KeywordRecommenders/UShortKeywordRecommender.cs +++ b/src/Features/CSharp/Completion/KeywordRecommenders/UShortKeywordRecommender.cs @@ -3,7 +3,9 @@ using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CSharp.Completion.KeywordRecommenders { @@ -23,7 +25,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context context.IsStatementContext || context.IsGlobalStatementContext || context.IsObjectCreationTypeContext || - context.IsGenericTypeArgumentContext || + (context.IsGenericTypeArgumentContext && !context.TargetToken.Parent.HasAncestor()) || context.IsEnumBaseListContext || context.IsIsOrAsTypeContext || context.IsLocalVariableDeclarationContext ||