diff --git a/src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService.cs b/src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService.cs index 477c98bfd48b..6bd0dcd9faf7 100644 --- a/src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService.cs +++ b/src/Features/Core/Portable/DocumentHighlighting/AbstractDocumentHighlightsService.cs @@ -316,7 +316,7 @@ private static async Task AddLocationSpanAsync(Location location, Solution solut var root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false); var token = root.FindToken(location.SourceSpan.Start, findInsideTrivia: true); - return syntaxFacts.IsGenericName(token.Parent) || syntaxFacts.IsIndexerMemberCRef(token.Parent) + return syntaxFacts.IsGenericName(token.Parent) || syntaxFacts.IsIndexerMemberCref(token.Parent) ? new DocumentSpan(document, token.Span) : new DocumentSpan(document, location.SourceSpan); } diff --git a/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/PropertySymbolReferenceFinder.cs b/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/PropertySymbolReferenceFinder.cs index 2be9117e9a1e..aaba8196cc51 100644 --- a/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/PropertySymbolReferenceFinder.cs +++ b/src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/PropertySymbolReferenceFinder.cs @@ -188,7 +188,7 @@ private static async Task> FindIndexerReferencesA .Where(node => syntaxFacts.IsElementAccessExpression(node) || syntaxFacts.IsConditionalAccessExpression(node) || - syntaxFacts.IsIndexerMemberCRef(node)); + syntaxFacts.IsIndexerMemberCref(node)); using var _ = ArrayBuilder.GetInstance(out var locations); foreach (var node in indexerReferenceExpresssions) @@ -232,7 +232,7 @@ private static async Task> FindIndexerReferencesA } else { - Debug.Assert(syntaxFacts.IsIndexerMemberCRef(node)); + Debug.Assert(syntaxFacts.IsIndexerMemberCref(node)); return ComputeIndexerMemberCRefInformationAsync(symbol, state, node, cancellationToken); } } diff --git a/src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeIndex_Create.cs b/src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeIndex_Create.cs index febe19ec441a..bfe0235474c1 100644 --- a/src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeIndex_Create.cs +++ b/src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeIndex_Create.cs @@ -88,7 +88,7 @@ private static SyntaxTreeIndex CreateIndex( containsUsingStatement = containsUsingStatement || syntaxFacts.IsUsingStatement(node); containsQueryExpression = containsQueryExpression || syntaxFacts.IsQueryExpression(node); containsElementAccess = containsElementAccess || syntaxFacts.IsElementAccessExpression(node); - containsIndexerMemberCref = containsIndexerMemberCref || syntaxFacts.IsIndexerMemberCRef(node); + containsIndexerMemberCref = containsIndexerMemberCref || syntaxFacts.IsIndexerMemberCref(node); containsDeconstruction = containsDeconstruction || syntaxFacts.IsDeconstructionAssignment(node) || syntaxFacts.IsDeconstructionForEachStatement(node); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs index 6d30bca5ccf0..37832ab2fafa 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs @@ -682,9 +682,6 @@ public bool IsElementAccessExpression(SyntaxNode? node) public SyntaxNode? ConvertToSingleLine(SyntaxNode? node, bool useElasticTrivia = false) => node.ConvertToSingleLine(useElasticTrivia); - public bool IsIndexerMemberCRef(SyntaxNode? node) - => node.IsKind(SyntaxKind.IndexerMemberCref); - public SyntaxNode? GetContainingMemberDeclaration(SyntaxNode root, int position, bool useFullSpan = true) { var end = root.FullSpan.End; @@ -1350,12 +1347,6 @@ public SyntaxNode GetExpressionOfForeachStatement(SyntaxNode node) public SyntaxNode GetExpressionOfExpressionStatement(SyntaxNode node) => ((ExpressionStatementSyntax)node).Expression; - public bool IsIsTypeExpression([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.IsExpression); - - public bool IsIsNotTypeExpression([NotNullWhen(true)] SyntaxNode? node) - => false; - public void GetPartsOfTupleExpression(SyntaxNode node, out SyntaxToken openParen, out SeparatedSyntaxList arguments, out SyntaxToken closeParen) where TArgumentSyntax : SyntaxNode { @@ -1433,9 +1424,6 @@ public SyntaxList GetContentFromDocumentationCommentTriviaSyntax(Syn throw ExceptionUtilities.UnexpectedValue(trivia.Kind()); } - public bool IsIsPatternExpression([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.IsPatternExpression); - public void GetPartsOfAnyIsTypeExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode type) { var isPatternExpression = (BinaryExpressionSyntax)node; @@ -1454,18 +1442,6 @@ public void GetPartsOfIsPatternExpression(SyntaxNode node, out SyntaxNode left, public bool IsAnyPattern([NotNullWhen(true)] SyntaxNode? node) => node is PatternSyntax; - public bool IsConstantPattern([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.ConstantPattern); - - public bool IsDeclarationPattern([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.DeclarationPattern); - - public bool IsRecursivePattern([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.RecursivePattern); - - public bool IsVarPattern([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.VarPattern); - public SyntaxNode GetExpressionOfConstantPattern(SyntaxNode node) => ((ConstantPatternSyntax)node).Expression; @@ -1492,24 +1468,9 @@ public bool SupportsNotPattern(ParseOptions options) public bool SupportsIsNotTypeExpression(ParseOptions options) => false; - public bool IsAndPattern([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.AndPattern); - public bool IsBinaryPattern([NotNullWhen(true)] SyntaxNode? node) => node is BinaryPatternSyntax; - public bool IsNotPattern([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.NotPattern); - - public bool IsOrPattern([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.OrPattern); - - public bool IsParenthesizedPattern([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.ParenthesizedPattern); - - public bool IsTypePattern([NotNullWhen(true)] SyntaxNode? node) - => node.IsKind(SyntaxKind.TypePattern); - public bool IsUnaryPattern([NotNullWhen(true)] SyntaxNode? node) => node is UnaryPatternSyntax; diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxKinds.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxKinds.cs index e2697427c213..59a64f7bfd1a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxKinds.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxKinds.cs @@ -74,6 +74,9 @@ public TSyntaxKind Convert(int kind) where TSyntaxKind : struct public int? ImplicitObjectCreationExpression => (int)SyntaxKind.ImplicitObjectCreationExpression; public int? IndexExpression => (int)SyntaxKind.IndexExpression; public int InvocationExpression => (int)SyntaxKind.InvocationExpression; + public int? IsPatternExpression => (int)SyntaxKind.IsPatternExpression; + public int IsTypeExpression => (int)SyntaxKind.IsExpression; + public int? IsNotTypeExpression => null; public int LogicalAndExpression => (int)SyntaxKind.LogicalAndExpression; public int LogicalOrExpression => (int)SyntaxKind.LogicalOrExpression; public int LogicalNotExpression => (int)SyntaxKind.LogicalNotExpression; @@ -90,6 +93,16 @@ public TSyntaxKind Convert(int kind) where TSyntaxKind : struct public int? ThrowExpression => (int)SyntaxKind.ThrowExpression; public int TupleExpression => (int)SyntaxKind.TupleExpression; + public int? AndPattern => (int)SyntaxKind.AndPattern; + public int? ConstantPattern => (int)SyntaxKind.ConstantPattern; + public int? DeclarationPattern => (int)SyntaxKind.DeclarationPattern; + public int? NotPattern => (int)SyntaxKind.NotPattern; + public int? OrPattern => (int)SyntaxKind.OrPattern; + public int? ParenthesizedPattern => (int)SyntaxKind.ParenthesizedPattern; + public int? RecursivePattern => (int)SyntaxKind.RecursivePattern; + public int? TypePattern => (int)SyntaxKind.TypePattern; + public int? VarPattern => (int)SyntaxKind.VarPattern; + public int EndOfFileToken => (int)SyntaxKind.EndOfFileToken; public int AwaitKeyword => (int)SyntaxKind.AwaitKeyword; public int AsyncKeyword => (int)SyntaxKind.AsyncKeyword; @@ -126,5 +139,6 @@ public TSyntaxKind Convert(int kind) where TSyntaxKind : struct public int Interpolation => (int)SyntaxKind.Interpolation; public int InterpolatedStringExpression => (int)SyntaxKind.InterpolatedStringExpression; public int InterpolatedStringText => (int)SyntaxKind.InterpolatedStringText; + public int? IndexerMemberCref => (int)SyntaxKind.IndexerMemberCref; } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs index 58939dad74c2..589d5e603045 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs @@ -194,11 +194,6 @@ internal interface ISyntaxFacts bool IsDeclarationExpression([NotNullWhen(true)] SyntaxNode? node); - bool IsIsTypeExpression([NotNullWhen(true)] SyntaxNode? node); - bool IsIsNotTypeExpression([NotNullWhen(true)] SyntaxNode? node); - - bool IsIsPatternExpression([NotNullWhen(true)] SyntaxNode? node); - bool IsConversionExpression([NotNullWhen(true)] SyntaxNode? node); bool IsCastExpression([NotNullWhen(true)] SyntaxNode? node); @@ -368,7 +363,6 @@ void GetPartsOfTupleExpression(SyntaxNode node, bool IsBaseConstructorInitializer(SyntaxToken token); bool IsQueryKeyword(SyntaxToken token); bool IsElementAccessExpression([NotNullWhen(true)] SyntaxNode? node); - bool IsIndexerMemberCRef([NotNullWhen(true)] SyntaxNode? node); bool IsIdentifierStartCharacter(char c); bool IsIdentifierPartCharacter(char c); bool IsIdentifierEscapeCharacter(char c); @@ -461,18 +455,8 @@ void GetPartsOfTupleExpression(SyntaxNode node, bool IsPropertyPatternClause(SyntaxNode node); bool IsAnyPattern([NotNullWhen(true)] SyntaxNode? node); - - bool IsAndPattern([NotNullWhen(true)] SyntaxNode? node); bool IsBinaryPattern([NotNullWhen(true)] SyntaxNode? node); - bool IsConstantPattern([NotNullWhen(true)] SyntaxNode? node); - bool IsDeclarationPattern([NotNullWhen(true)] SyntaxNode? node); - bool IsNotPattern([NotNullWhen(true)] SyntaxNode? node); - bool IsOrPattern([NotNullWhen(true)] SyntaxNode? node); - bool IsParenthesizedPattern([NotNullWhen(true)] SyntaxNode? node); - bool IsRecursivePattern([NotNullWhen(true)] SyntaxNode? node); - bool IsTypePattern([NotNullWhen(true)] SyntaxNode? node); bool IsUnaryPattern([NotNullWhen(true)] SyntaxNode? node); - bool IsVarPattern([NotNullWhen(true)] SyntaxNode? node); SyntaxNode GetExpressionOfConstantPattern(SyntaxNode node); SyntaxNode GetTypeOfTypePattern(SyntaxNode node); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFactsExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFactsExtensions.cs index 91654ce981e4..d0612c936fde 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFactsExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFactsExtensions.cs @@ -797,6 +797,15 @@ public static bool IsInterpolatedStringText(this ISyntaxFacts syntaxFacts, [NotN public static bool IsInvocationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) => node?.RawKind == syntaxFacts.SyntaxKinds.InvocationExpression; + public static bool IsIsTypeExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.IsTypeExpression; + + public static bool IsIsNotTypeExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.IsNotTypeExpression; + + public static bool IsIsPatternExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.IsPatternExpression; + public static bool IsLogicalAndExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) => node?.RawKind == syntaxFacts.SyntaxKinds.LogicalAndExpression; @@ -838,6 +847,37 @@ public static bool ContainsGlobalStatement(this ISyntaxFacts syntaxFacts, Syntax #endregion + #region pattern + + public static bool IsAndPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.AndPattern; + + public static bool IsConstantPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.ConstantPattern; + + public static bool IsDeclarationPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.DeclarationPattern; + + public static bool IsNotPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.NotPattern; + + public static bool IsOrPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.OrPattern; + + public static bool IsParenthesizedPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.ParenthesizedPattern; + + public static bool IsRecursivePattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.RecursivePattern; + + public static bool IsTypePattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.TypePattern; + + public static bool IsVarPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.VarPattern; + + #endregion + #region statements public static bool IsExpressionStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) @@ -907,6 +947,13 @@ public static bool IsEqualsValueClause(this ISyntaxFacts syntaxFacts, [NotNullWh #endregion + #region other + + public static bool IsIndexerMemberCref(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) + => node?.RawKind == syntaxFacts.SyntaxKinds.IndexerMemberCref; + + #endregion + #endregion } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxKinds.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxKinds.cs index 94e15e26ce37..67a6dde33541 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxKinds.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxKinds.cs @@ -121,6 +121,9 @@ internal interface ISyntaxKinds int? IndexExpression { get; } int InterpolatedStringExpression { get; } int InvocationExpression { get; } + int IsTypeExpression { get; } + int? IsNotTypeExpression { get; } + int? IsPatternExpression { get; } int LogicalAndExpression { get; } int LogicalOrExpression { get; } int LogicalNotExpression { get; } @@ -139,6 +142,20 @@ internal interface ISyntaxKinds #endregion + #region patterns + + int? AndPattern { get; } + int? ConstantPattern { get; } + int? DeclarationPattern { get; } + int? NotPattern { get; } + int? OrPattern { get; } + int? ParenthesizedPattern { get; } + int? RecursivePattern { get; } + int? TypePattern { get; } + int? VarPattern { get; } + + #endregion + #region statements int ExpressionStatement { get; } @@ -181,6 +198,7 @@ internal interface ISyntaxKinds int Interpolation { get; } int InterpolatedStringText { get; } + int? IndexerMemberCref { get; } #endregion } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb index 417963acc139..9dd4d551fb11 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb @@ -701,10 +701,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices Return node.Kind = SyntaxKind.InvocationExpression OrElse node.Kind = SyntaxKind.DictionaryAccessExpression End Function - Public Function IsIndexerMemberCRef(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsIndexerMemberCRef - Return False - End Function - Public Function GetContainingMemberDeclaration(root As SyntaxNode, position As Integer, Optional useFullSpan As Boolean = True) As SyntaxNode Implements ISyntaxFacts.GetContainingMemberDeclaration Dim [end] = root.FullSpan.End If [end] = 0 Then @@ -1432,14 +1428,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices Return DirectCast(node, ExpressionStatementSyntax).Expression End Function - Public Function IsIsTypeExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsIsTypeExpression - Return node.IsKind(SyntaxKind.TypeOfIsExpression) - End Function - - Public Function IsIsNotTypeExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsIsNotTypeExpression - Return node.IsKind(SyntaxKind.TypeOfIsNotExpression) - End Function - Public Sub GetPartsOfTupleExpression(Of TArgumentSyntax As SyntaxNode)(node As SyntaxNode, ByRef openParen As SyntaxToken, ByRef arguments As SeparatedSyntaxList(Of TArgumentSyntax), ByRef closeParen As SyntaxToken) Implements ISyntaxFacts.GetPartsOfTupleExpression Dim tupleExpr = DirectCast(node, TupleExpressionSyntax) openParen = tupleExpr.OpenParenToken @@ -1664,58 +1652,18 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices Return DirectCast(options, VisualBasicParseOptions).LanguageVersion >= LanguageVersion.VisualBasic14 End Function - Public Function IsIsPatternExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsIsPatternExpression - Return False - End Function - Public Function IsAnyPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyPattern Return False End Function - Public Function IsAndPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAndPattern - Return False - End Function - Public Function IsBinaryPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsBinaryPattern Return False End Function - Public Function IsConstantPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsConstantPattern - Return False - End Function - - Public Function IsDeclarationPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeclarationPattern - Return False - End Function - - Public Function IsNotPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNotPattern - Return False - End Function - - Public Function IsOrPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsOrPattern - Return False - End Function - - Public Function IsParenthesizedPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsParenthesizedPattern - Return False - End Function - - Public Function IsRecursivePattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsRecursivePattern - Return False - End Function - Public Function IsUnaryPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUnaryPattern Return False End Function - Public Function IsTypePattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsTypePattern - Return False - End Function - - Public Function IsVarPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsVarPattern - Return False - End Function - Public Sub GetPartsOfAnyIsTypeExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef type As SyntaxNode) Implements ISyntaxFacts.GetPartsOfAnyIsTypeExpression Dim typeOfExpression = DirectCast(node, TypeOfExpressionSyntax) expression = typeOfExpression.Expression diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxKinds.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxKinds.vb index 82ca88305ff6..f89e9a380888 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxKinds.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxKinds.vb @@ -39,11 +39,11 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices Public ReadOnly Property InterpolatedStringTextToken As Integer = SyntaxKind.InterpolatedStringTextToken Implements ISyntaxKinds.InterpolatedStringTextToken Public ReadOnly Property QuestionToken As Integer = SyntaxKind.QuestionToken Implements ISyntaxKinds.QuestionToken Public ReadOnly Property StringLiteralToken As Integer = SyntaxKind.StringLiteralToken Implements ISyntaxKinds.StringLiteralToken - Public ReadOnly Property SingleLineRawStringLiteralToken As Integer? = Nothing Implements ISyntaxKinds.SingleLineRawStringLiteralToken - Public ReadOnly Property MultiLineRawStringLiteralToken As Integer? = Nothing Implements ISyntaxKinds.MultiLineRawStringLiteralToken - Public ReadOnly Property Utf8StringLiteralToken As Integer? = Nothing Implements ISyntaxKinds.Utf8StringLiteralToken - Public ReadOnly Property Utf8SingleLineRawStringLiteralToken As Integer? = Nothing Implements ISyntaxKinds.Utf8SingleLineRawStringLiteralToken - Public ReadOnly Property Utf8MultiLineRawStringLiteralToken As Integer? = Nothing Implements ISyntaxKinds.Utf8MultiLineRawStringLiteralToken + Public ReadOnly Property SingleLineRawStringLiteralToken As Integer? Implements ISyntaxKinds.SingleLineRawStringLiteralToken + Public ReadOnly Property MultiLineRawStringLiteralToken As Integer? Implements ISyntaxKinds.MultiLineRawStringLiteralToken + Public ReadOnly Property Utf8StringLiteralToken As Integer? Implements ISyntaxKinds.Utf8StringLiteralToken + Public ReadOnly Property Utf8SingleLineRawStringLiteralToken As Integer? Implements ISyntaxKinds.Utf8SingleLineRawStringLiteralToken + Public ReadOnly Property Utf8MultiLineRawStringLiteralToken As Integer? Implements ISyntaxKinds.Utf8MultiLineRawStringLiteralToken Public ReadOnly Property XmlTextLiteralToken As Integer = SyntaxKind.XmlTextLiteralToken Implements ISyntaxKinds.XmlTextLiteralToken @@ -72,26 +72,40 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices Public ReadOnly Property BaseExpression As Integer = SyntaxKind.MyBaseExpression Implements ISyntaxKinds.BaseExpression Public ReadOnly Property ConditionalAccessExpression As Integer = SyntaxKind.ConditionalAccessExpression Implements ISyntaxKinds.ConditionalAccessExpression Public ReadOnly Property ConditionalExpression As Integer = SyntaxKind.TernaryConditionalExpression Implements ISyntaxKinds.ConditionalExpression - Public ReadOnly Property ImplicitArrayCreationExpression As Integer? = Nothing Implements ISyntaxKinds.ImplicitArrayCreationExpression - Public ReadOnly Property ImplicitObjectCreationExpression As Integer? = Nothing Implements ISyntaxKinds.ImplicitObjectCreationExpression - Public ReadOnly Property IndexExpression As Integer? = Nothing Implements ISyntaxKinds.IndexExpression + Public ReadOnly Property ImplicitArrayCreationExpression As Integer? Implements ISyntaxKinds.ImplicitArrayCreationExpression + Public ReadOnly Property ImplicitObjectCreationExpression As Integer? Implements ISyntaxKinds.ImplicitObjectCreationExpression + Public ReadOnly Property IndexExpression As Integer? Implements ISyntaxKinds.IndexExpression Public ReadOnly Property InvocationExpression As Integer = SyntaxKind.InvocationExpression Implements ISyntaxKinds.InvocationExpression + Public ReadOnly Property IsTypeExpression As Integer = SyntaxKind.TypeOfIsExpression Implements ISyntaxKinds.IsTypeExpression + Public ReadOnly Property IsNotTypeExpression As Integer? = SyntaxKind.TypeOfIsNotExpression Implements ISyntaxKinds.IsNotTypeExpression + Public ReadOnly Property IsPatternExpression As Integer? Implements ISyntaxKinds.IsPatternExpression Public ReadOnly Property LogicalAndExpression As Integer = SyntaxKind.AndAlsoExpression Implements ISyntaxKinds.LogicalAndExpression Public ReadOnly Property LogicalOrExpression As Integer = SyntaxKind.OrElseExpression Implements ISyntaxKinds.LogicalOrExpression Public ReadOnly Property LogicalNotExpression As Integer = SyntaxKind.NotExpression Implements ISyntaxKinds.LogicalNotExpression Public ReadOnly Property ObjectCreationExpression As Integer = SyntaxKind.ObjectCreationExpression Implements ISyntaxKinds.ObjectCreationExpression Public ReadOnly Property ParenthesizedExpression As Integer = SyntaxKind.ParenthesizedExpression Implements ISyntaxKinds.ParenthesizedExpression Public ReadOnly Property QueryExpression As Integer = SyntaxKind.QueryExpression Implements ISyntaxKinds.QueryExpression - Public ReadOnly Property RangeExpression As Integer? = Nothing Implements ISyntaxKinds.RangeExpression - Public ReadOnly Property RefExpression As Integer? = Nothing Implements ISyntaxKinds.RefExpression + Public ReadOnly Property RangeExpression As Integer? Implements ISyntaxKinds.RangeExpression + Public ReadOnly Property RefExpression As Integer? Implements ISyntaxKinds.RefExpression Public ReadOnly Property ReferenceEqualsExpression As Integer = SyntaxKind.IsExpression Implements ISyntaxKinds.ReferenceEqualsExpression Public ReadOnly Property ReferenceNotEqualsExpression As Integer = SyntaxKind.IsNotExpression Implements ISyntaxKinds.ReferenceNotEqualsExpression Public ReadOnly Property SimpleMemberAccessExpression As Integer = SyntaxKind.SimpleMemberAccessExpression Implements ISyntaxKinds.SimpleMemberAccessExpression Public ReadOnly Property TernaryConditionalExpression As Integer = SyntaxKind.TernaryConditionalExpression Implements ISyntaxKinds.TernaryConditionalExpression Public ReadOnly Property ThisExpression As Integer = SyntaxKind.MeExpression Implements ISyntaxKinds.ThisExpression - Public ReadOnly Property ThrowExpression As Integer? = Nothing Implements ISyntaxKinds.ThrowExpression + Public ReadOnly Property ThrowExpression As Integer? Implements ISyntaxKinds.ThrowExpression Public ReadOnly Property TupleExpression As Integer = SyntaxKind.TupleExpression Implements ISyntaxKinds.TupleExpression + Public ReadOnly Property AndPattern As Integer? Implements ISyntaxKinds.AndPattern + Public ReadOnly Property ConstantPattern As Integer? Implements ISyntaxKinds.ConstantPattern + Public ReadOnly Property DeclarationPattern As Integer? Implements ISyntaxKinds.DeclarationPattern + Public ReadOnly Property NotPattern As Integer? Implements ISyntaxKinds.NotPattern + Public ReadOnly Property OrPattern As Integer? Implements ISyntaxKinds.OrPattern + Public ReadOnly Property ParenthesizedPattern As Integer? Implements ISyntaxKinds.ParenthesizedPattern + Public ReadOnly Property RecursivePattern As Integer? Implements ISyntaxKinds.RecursivePattern + Public ReadOnly Property TypePattern As Integer? Implements ISyntaxKinds.TypePattern + Public ReadOnly Property VarPattern As Integer? Implements ISyntaxKinds.VarPattern + Public ReadOnly Property IndexerMemberCref As Integer? Implements ISyntaxKinds.IndexerMemberCref + Public ReadOnly Property EndOfFileToken As Integer = SyntaxKind.EndOfFileToken Implements ISyntaxKinds.EndOfFileToken Public ReadOnly Property AwaitKeyword As Integer = SyntaxKind.AwaitKeyword Implements ISyntaxKinds.AwaitKeyword Public ReadOnly Property AsyncKeyword As Integer = SyntaxKind.AsyncKeyword Implements ISyntaxKinds.AsyncKeyword @@ -105,7 +119,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices Public ReadOnly Property ForEachStatement As Integer = SyntaxKind.ForEachStatement Implements ISyntaxKinds.ForEachStatement Public ReadOnly Property IfStatement As Integer = SyntaxKind.IfStatement Implements ISyntaxKinds.IfStatement Public ReadOnly Property LocalDeclarationStatement As Integer = SyntaxKind.LocalDeclarationStatement Implements ISyntaxKinds.LocalDeclarationStatement - Public ReadOnly Property LocalFunctionStatement As Integer? = Nothing Implements ISyntaxKinds.LocalFunctionStatement + Public ReadOnly Property LocalFunctionStatement As Integer? Implements ISyntaxKinds.LocalFunctionStatement Public ReadOnly Property LockStatement As Integer = SyntaxKind.SyncLockStatement Implements ISyntaxKinds.LockStatement Public ReadOnly Property ReturnStatement As Integer = SyntaxKind.ReturnStatement Implements ISyntaxKinds.ReturnStatement Public ReadOnly Property ThrowStatement As Integer = SyntaxKind.ThrowStatement Implements ISyntaxKinds.ThrowStatement @@ -114,8 +128,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices Public ReadOnly Property Attribute As Integer = SyntaxKind.Attribute Implements ISyntaxKinds.Attribute Public ReadOnly Property ClassDeclaration As Integer = SyntaxKind.ClassBlock Implements ISyntaxKinds.ClassDeclaration - Public ReadOnly Property RecordDeclaration As Integer? = Nothing Implements ISyntaxKinds.RecordDeclaration - Public ReadOnly Property RecordStructDeclaration As Integer? = Nothing Implements ISyntaxKinds.RecordStructDeclaration + Public ReadOnly Property RecordDeclaration As Integer? Implements ISyntaxKinds.RecordDeclaration + Public ReadOnly Property RecordStructDeclaration As Integer? Implements ISyntaxKinds.RecordStructDeclaration Public ReadOnly Property Parameter As Integer = SyntaxKind.Parameter Implements ISyntaxKinds.Parameter Public ReadOnly Property TypeConstraint As Integer = SyntaxKind.TypeConstraint Implements ISyntaxKinds.TypeConstraint Public ReadOnly Property VariableDeclarator As Integer = SyntaxKind.VariableDeclarator Implements ISyntaxKinds.VariableDeclarator