Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ValidateFormatString

For Each argument In arguments
Dim simpleArgumentSyntax = TryCast(argument, SimpleArgumentSyntax)
If Not simpleArgumentSyntax Is Nothing AndAlso simpleArgumentSyntax.NameColonEquals?.Name.Identifier.ValueText.Equals(searchArgumentName) Then
If simpleArgumentSyntax IsNot Nothing AndAlso simpleArgumentSyntax.NameColonEquals?.Name.Identifier.ValueText.Equals(searchArgumentName) Then
Return argument
End If
Next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddAnonymousTypeMemberName
ImmutableArray.Create(BC36556)

Protected Overrides Function HasName(declarator As FieldInitializerSyntax) As Boolean
Return Not TypeOf declarator Is InferredFieldInitializerSyntax
Return TypeOf declarator IsNot InferredFieldInitializerSyntax
End Function

Protected Overrides Function GetExpression(declarator As FieldInitializerSyntax) As ExpressionSyntax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.GenerateMember.GenerateMethod

Protected Overrides Function GetCapturedTypeParameters(cancellationToken As CancellationToken) As ImmutableArray(Of ITypeParameterSymbol)
Dim result = New List(Of ITypeParameterSymbol)()
If Not Me.InvocationExpression.ArgumentList Is Nothing Then
If Me.InvocationExpression.ArgumentList IsNot Nothing Then
For Each argument In Me.InvocationExpression.ArgumentList.Arguments
Dim type = DetermineParameterType(argument, cancellationToken)
type.GetReferencedTypeParameters(result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Expansion
End Function

Private Shared Function GetExpressionSyntaxWithSameSpan(node As SyntaxNode, spanEnd As Integer) As SyntaxNode
While Not node Is Nothing And Not node.Parent Is Nothing And node.Parent.SpanStart = node.SpanStart
While node IsNot Nothing And node.Parent IsNot Nothing And node.Parent.SpanStart = node.SpanStart
node = node.Parent
If node.Span.End = spanEnd Then
Exit While
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Simplification
End Function

Private Shared Function GetExpressionSyntaxWithSameSpan(node As SyntaxNode, spanEnd As Integer) As SyntaxNode
While Not node Is Nothing And Not node.Parent Is Nothing And node.Parent.SpanStart = node.SpanStart
While node IsNot Nothing And node.Parent IsNot Nothing And node.Parent.SpanStart = node.SpanStart
node = node.Parent
If node.Span.End = spanEnd Then
Exit While
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
Public Async Function AssertSessionIsNothingOrNoCompletionItemLike(text As String) As Task
Await WaitForAsynchronousOperationsAsync()
Dim session = GetExportedValue(Of IAsyncCompletionBroker)().GetSession(TextView)
If Not session Is Nothing Then
If session IsNot Nothing Then
Await AssertCompletionItemsDoNotContainAny(text)
End If
End Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
End If

Dim containingStatement = token.GetAncestors(Of StatementSyntax) _
.Where(Function(a) Not TypeOf a Is LambdaHeaderSyntax) _
.Where(Function(a) TypeOf a IsNot LambdaHeaderSyntax) _
.FirstOrDefault()

Dim containingTypeStatement = TryCast(containingStatement, TypeStatementSyntax)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.CodeRefactorings.M
) As Task

Dim expectedText As String = Nothing
If Not expectedCode Is Nothing Then
If expectedCode IsNot Nothing Then
expectedText = expectedCode.ConvertTestSourceTag()
End If

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.BraceCompletion
If skippedTriviaNode IsNot Nothing Then
Dim skippedToken = skippedTriviaNode.ParentTrivia.Token
' These checks don't make any sense. Leaving them in place to avoid breaking something as part of this move.
If skippedToken.Kind <> SyntaxKind.CloseParenToken OrElse Not TypeOf skippedToken.Parent Is BinaryConditionalExpressionSyntax Then
If skippedToken.Kind <> SyntaxKind.CloseParenToken OrElse TypeOf skippedToken.Parent IsNot BinaryConditionalExpressionSyntax Then
Return False
End If
End If
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Protected Overrides Function GetAssemblyScopedAttributeSyntaxNodesOfDocument(documentRoot As SyntaxNode) As IImmutableList(Of SyntaxNode)
Dim builder As ImmutableList(Of SyntaxNode).Builder = Nothing
Dim compilationUnit = TryCast(documentRoot, CompilationUnitSyntax)
If Not compilationUnit Is Nothing Then
If compilationUnit IsNot Nothing Then
For Each attributeStatement In compilationUnit.Attributes
For Each attributeList In attributeStatement.AttributeLists
builder = If(builder, ImmutableList.CreateBuilder(Of SyntaxNode)())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.KeywordRecommenders.Decl
End If

' Compute some basic properties of what is allowed at all in this context
Dim byRefAllowed = Not TypeOf methodDeclaration Is AccessorStatementSyntax AndAlso
Dim byRefAllowed = TypeOf methodDeclaration IsNot AccessorStatementSyntax AndAlso
methodDeclaration.Kind <> SyntaxKind.PropertyStatement AndAlso
methodDeclaration.Kind <> SyntaxKind.OperatorStatement

Dim optionalAndParamArrayAllowed = Not TypeOf methodDeclaration Is DelegateStatementSyntax AndAlso
Not TypeOf methodDeclaration Is LambdaHeaderSyntax AndAlso
Not TypeOf methodDeclaration Is AccessorStatementSyntax AndAlso
Dim optionalAndParamArrayAllowed = TypeOf methodDeclaration IsNot DelegateStatementSyntax AndAlso
TypeOf methodDeclaration IsNot LambdaHeaderSyntax AndAlso
TypeOf methodDeclaration IsNot AccessorStatementSyntax AndAlso
methodDeclaration.Kind <> SyntaxKind.EventStatement AndAlso
methodDeclaration.Kind <> SyntaxKind.OperatorStatement

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExtractMethod
Return True
End If

Return Not TypeOf methodBlock.BlockStatement Is SubNewStatementSyntax
Return TypeOf methodBlock.BlockStatement IsNot SubNewStatementSyntax
End Function
End Class
End Class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.KeywordHighlighting

Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Dim methodBlock = node.GetAncestor(Of MethodBlockBaseSyntax)()
If methodBlock Is Nothing OrElse Not TypeOf methodBlock.BlockStatement Is AccessorStatementSyntax Then
If methodBlock Is Nothing OrElse TypeOf methodBlock.BlockStatement IsNot AccessorStatementSyntax Then
Return
End If

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.KeywordHighlighting

Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Dim methodBlock = node.GetAncestor(Of MethodBlockBaseSyntax)()
If methodBlock Is Nothing OrElse Not TypeOf methodBlock.BlockStatement Is SubNewStatementSyntax Then
If methodBlock Is Nothing OrElse TypeOf methodBlock.BlockStatement IsNot SubNewStatementSyntax Then
Return
End If

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.KeywordHighlighting

Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Dim methodBlock = node.GetAncestor(Of MethodBlockBaseSyntax)()
If methodBlock Is Nothing OrElse Not TypeOf methodBlock.BlockStatement Is MethodStatementSyntax Then
If methodBlock Is Nothing OrElse TypeOf methodBlock.BlockStatement IsNot MethodStatementSyntax Then
Return
End If

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.KeywordHighlighting

Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Dim methodBlock = node.GetAncestor(Of MethodBlockBaseSyntax)()
If methodBlock Is Nothing OrElse Not TypeOf methodBlock.BlockStatement Is OperatorStatementSyntax Then
If methodBlock Is Nothing OrElse TypeOf methodBlock.BlockStatement IsNot OperatorStatementSyntax Then
Return
End If

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.KeywordHighlighting
End If

Dim child = childNodeOrToken.AsNode()
If Not TypeOf child Is TryBlockSyntax AndAlso Not TypeOf child Is LambdaExpressionSyntax Then
If TypeOf child IsNot TryBlockSyntax AndAlso TypeOf child IsNot LambdaExpressionSyntax Then
HighlightRelatedStatements(child, highlights)
End If
Next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.KeywordHighlighting
End With
Else
For Each child In node.ChildNodes()
If Not TypeOf child Is T AndAlso
Not TypeOf child Is LambdaExpressionSyntax Then
If TypeOf child IsNot T AndAlso
TypeOf child IsNot LambdaExpressionSyntax Then

HighlightRelatedStatements(Of T)(child, highlights, blockKind, checkReturns)
End If
Expand Down Expand Up @@ -106,7 +106,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.KeywordHighlighting
End If

For Each child In node.ChildNodes()
If Not TypeOf child Is LambdaExpressionSyntax Then
If TypeOf child IsNot LambdaExpressionSyntax Then
HighlightRelatedAwaits(child, highlights, cancellationToken)
End If
Next
Expand All @@ -119,7 +119,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.KeywordHighlighting
End With
Else
For Each child In node.ChildNodes()
If Not TypeOf child Is LambdaExpressionSyntax Then
If TypeOf child IsNot LambdaExpressionSyntax Then
HighlightRelatedYieldStatements(Of T)(child, highlights)
End If
Next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Diagnostics.Suppre
Return True
End If

Return Not TypeOf n Is StatementSyntax
Return TypeOf n IsNot StatementSyntax
End Function,
verifier:=Function(t) t.IndexOf("SuppressMessage", StringComparison.Ordinal) >= 0)
End Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel.MethodXm
Return False
End If

If Not TypeOf constantValue.Value Is Integer Then
If TypeOf constantValue.Value IsNot Integer Then
Return False
End If

Expand All @@ -547,15 +547,15 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel.MethodXm
End Function

Private Function TryGenerateSimpleArrayBound(argument As ArgumentSyntax) As Boolean
If Not TypeOf argument Is SimpleArgumentSyntax Then
If TypeOf argument IsNot SimpleArgumentSyntax Then
Return False
End If

Return TryGenerateConstantArrayBound(DirectCast(argument, SimpleArgumentSyntax).Expression)
End Function

Private Function TryGenerateRangeArrayBound(argument As ArgumentSyntax) As Boolean
If Not TypeOf argument Is RangeArgumentSyntax Then
If TypeOf argument IsNot RangeArgumentSyntax Then
Return False
End If

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel
Private Shared Function GetImportsClauses(importsStatements As SyntaxList(Of ImportsStatementSyntax)) As IReadOnlyList(Of ImportsClauseSyntax)
Return importsStatements _
.SelectMany(Function(i) i.ImportsClauses) _
.Where(Function(i) Not TypeOf i Is XmlNamespaceImportsClauseSyntax) _
.Where(Function(i) TypeOf i IsNot XmlNamespaceImportsClauseSyntax) _
.ToArray()
End Function

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel
End If

Case SyntaxKind.EventStatement
If Not TypeOf node.Parent Is EventBlockSyntax Then
If TypeOf node.Parent IsNot EventBlockSyntax Then
If scope = EnvDTE.vsCMElement.vsCMElementEvent Then
Return True
End If
Expand All @@ -239,7 +239,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel
End If

Case SyntaxKind.PropertyStatement
If Not TypeOf node.Parent Is PropertyBlockSyntax Then
If TypeOf node.Parent IsNot PropertyBlockSyntax Then
If scope = EnvDTE.vsCMElement.vsCMElementProperty Then
Return True
End If
Expand Down Expand Up @@ -1528,7 +1528,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel

If TypeOf member Is TypeBlockSyntax OrElse
TypeOf member Is EnumBlockSyntax Then
If Not TypeOf member.Parent Is TypeBlockSyntax AndAlso
If TypeOf member.Parent IsNot TypeBlockSyntax AndAlso
(newAccess = EnvDTE.vsCMAccess.vsCMAccessPrivate OrElse
newAccess = EnvDTE.vsCMAccess.vsCMAccessProtected OrElse
newAccess = EnvDTE.vsCMAccess.vsCMAccessProjectOrProtected) Then
Expand Down Expand Up @@ -2084,7 +2084,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel

Public Overrides Function ValidateFunctionKind(containerNode As SyntaxNode, kind As EnvDTE.vsCMFunction, name As String) As EnvDTE.vsCMFunction
If kind = EnvDTE.vsCMFunction.vsCMFunctionSub Then
Return If(name = "New" AndAlso Not TypeOf containerNode Is InterfaceBlockSyntax,
Return If(name = "New" AndAlso TypeOf containerNode IsNot InterfaceBlockSyntax,
EnvDTE.vsCMFunction.vsCMFunctionConstructor,
kind)
End If
Expand Down Expand Up @@ -4163,9 +4163,9 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel
End Function

Public Overrides Function GetFunctionExtender(name As String, node As SyntaxNode, symbol As ISymbol) As Object
If Not TypeOf node Is MethodBlockBaseSyntax AndAlso
Not TypeOf node Is MethodStatementSyntax AndAlso
Not TypeOf symbol Is IMethodSymbol Then
If TypeOf node IsNot MethodBlockBaseSyntax AndAlso
TypeOf node IsNot MethodStatementSyntax AndAlso
TypeOf symbol IsNot IMethodSymbol Then

Throw Exceptions.ThrowEUnexpected()
End If
Expand All @@ -4188,16 +4188,16 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel
End Function

Public Overrides Function GetPropertyExtender(name As String, node As SyntaxNode, symbol As ISymbol) As Object
If Not TypeOf node Is PropertyBlockSyntax AndAlso
Not TypeOf node Is PropertyStatementSyntax AndAlso
Not TypeOf symbol Is IPropertySymbol Then
If TypeOf node IsNot PropertyBlockSyntax AndAlso
TypeOf node IsNot PropertyStatementSyntax AndAlso
TypeOf symbol IsNot IPropertySymbol Then

Throw Exceptions.ThrowEUnexpected()
End If

If StringComparer.OrdinalIgnoreCase.Equals(name, ExtenderNames.VBAutoPropertyExtender) Then
Dim isAutoImplemented = TypeOf node Is PropertyStatementSyntax AndAlso
Not TypeOf node.Parent Is InterfaceBlockSyntax
TypeOf node.Parent IsNot InterfaceBlockSyntax

Return AutoPropertyExtender.Create(isAutoImplemented)
End If
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Help
End Select

If _isNotMetadata Then
If Not TypeOf node.Parent Is InheritsOrImplementsStatementSyntax Then
If TypeOf node.Parent IsNot InheritsOrImplementsStatementSyntax Then
If TypeOf node.Parent Is DeclarationStatementSyntax OrElse TypeOf node.Parent Is FieldDeclarationSyntax Then
Return
End If
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions

Dim topMostExpression = node _
.AncestorsAndSelf() _
.TakeWhile(Function(n) Not TypeOf n Is StatementSyntax) _
.TakeWhile(Function(n) TypeOf n IsNot StatementSyntax) _
.OfType(Of ExpressionSyntax) _
.LastOrDefault()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Dim location = token.GetLocation()

For Each ancestor In token.GetAncestors(Of SyntaxNode)()
If Not TypeOf ancestor Is AggregationRangeVariableSyntax AndAlso
Not TypeOf ancestor Is CollectionRangeVariableSyntax AndAlso
Not TypeOf ancestor Is ExpressionRangeVariableSyntax AndAlso
Not TypeOf ancestor Is InferredFieldInitializerSyntax Then
If TypeOf ancestor IsNot AggregationRangeVariableSyntax AndAlso
TypeOf ancestor IsNot CollectionRangeVariableSyntax AndAlso
TypeOf ancestor IsNot ExpressionRangeVariableSyntax AndAlso
TypeOf ancestor IsNot InferredFieldInitializerSyntax Then

Dim symbol = semanticModel.GetDeclaredSymbol(ancestor, cancellationToken)

Expand Down
Loading
Loading