Skip to content

Commit 1f18834

Browse files
Switch to more modern vb construct (#76615)
2 parents 0396afe + 03adb27 commit 1f18834

File tree

42 files changed

+87
-87
lines changed

Some content is hidden

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

42 files changed

+87
-87
lines changed

src/Analyzers/VisualBasic/Analyzers/ValidateFormatString/VisualBasicValidateFormatStringDiagnosticAnalyzer.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ValidateFormatString
2424

2525
For Each argument In arguments
2626
Dim simpleArgumentSyntax = TryCast(argument, SimpleArgumentSyntax)
27-
If Not simpleArgumentSyntax Is Nothing AndAlso simpleArgumentSyntax.NameColonEquals?.Name.Identifier.ValueText.Equals(searchArgumentName) Then
27+
If simpleArgumentSyntax IsNot Nothing AndAlso simpleArgumentSyntax.NameColonEquals?.Name.Identifier.ValueText.Equals(searchArgumentName) Then
2828
Return argument
2929
End If
3030
Next

src/Analyzers/VisualBasic/CodeFixes/AddAnonymousTypeMemberName/VisualBasicAddAnonymousTypeMemberNameCodeFixProvider.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddAnonymousTypeMemberName
2828
ImmutableArray.Create(BC36556)
2929

3030
Protected Overrides Function HasName(declarator As FieldInitializerSyntax) As Boolean
31-
Return Not TypeOf declarator Is InferredFieldInitializerSyntax
31+
Return TypeOf declarator IsNot InferredFieldInitializerSyntax
3232
End Function
3333

3434
Protected Overrides Function GetExpression(declarator As FieldInitializerSyntax) As ExpressionSyntax

src/Analyzers/VisualBasic/CodeFixes/GenerateParameterizedMember/VisualBasicGenerateParameterizedMemberService.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.GenerateMember.GenerateMethod
6363

6464
Protected Overrides Function GetCapturedTypeParameters(cancellationToken As CancellationToken) As ImmutableArray(Of ITypeParameterSymbol)
6565
Dim result = New List(Of ITypeParameterSymbol)()
66-
If Not Me.InvocationExpression.ArgumentList Is Nothing Then
66+
If Me.InvocationExpression.ArgumentList IsNot Nothing Then
6767
For Each argument In Me.InvocationExpression.ArgumentList.Arguments
6868
Dim type = DetermineParameterType(argument, cancellationToken)
6969
type.GetReferencedTypeParameters(result)

src/EditorFeatures/Test2/Expansion/AbstractExpansionTest.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Expansion
5656
End Function
5757

5858
Private Shared Function GetExpressionSyntaxWithSameSpan(node As SyntaxNode, spanEnd As Integer) As SyntaxNode
59-
While Not node Is Nothing And Not node.Parent Is Nothing And node.Parent.SpanStart = node.SpanStart
59+
While node IsNot Nothing And node.Parent IsNot Nothing And node.Parent.SpanStart = node.SpanStart
6060
node = node.Parent
6161
If node.Span.End = spanEnd Then
6262
Exit While

src/EditorFeatures/Test2/Simplification/AbstractSimplificationTests.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Simplification
131131
End Function
132132

133133
Private Shared Function GetExpressionSyntaxWithSameSpan(node As SyntaxNode, spanEnd As Integer) As SyntaxNode
134-
While Not node Is Nothing And Not node.Parent Is Nothing And node.Parent.SpanStart = node.SpanStart
134+
While node IsNot Nothing And node.Parent IsNot Nothing And node.Parent.SpanStart = node.SpanStart
135135
node = node.Parent
136136
If node.Span.End = spanEnd Then
137137
Exit While

src/EditorFeatures/TestUtilities2/Intellisense/TestState.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
515515
Public Async Function AssertSessionIsNothingOrNoCompletionItemLike(text As String) As Task
516516
Await WaitForAsynchronousOperationsAsync()
517517
Dim session = GetExportedValue(Of IAsyncCompletionBroker)().GetSession(TextView)
518-
If Not session Is Nothing Then
518+
If session IsNot Nothing Then
519519
Await AssertCompletionItemsDoNotContainAny(text)
520520
End If
521521
End Function

src/EditorFeatures/VisualBasic/LineCommit/ContainingStatementInfo.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit
108108
End If
109109

110110
Dim containingStatement = token.GetAncestors(Of StatementSyntax) _
111-
.Where(Function(a) Not TypeOf a Is LambdaHeaderSyntax) _
111+
.Where(Function(a) TypeOf a IsNot LambdaHeaderSyntax) _
112112
.FirstOrDefault()
113113

114114
Dim containingTypeStatement = TryCast(containingStatement, TypeStatementSyntax)

src/EditorFeatures/VisualBasicTest/CodeActions/MoveType/BasicMoveTypeTestsBase.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.CodeRefactorings.M
3232
) As Task
3333

3434
Dim expectedText As String = Nothing
35-
If Not expectedCode Is Nothing Then
35+
If expectedCode IsNot Nothing Then
3636
expectedText = expectedCode.ConvertTestSourceTag()
3737
End If
3838

src/Features/VisualBasic/Portable/BraceCompletion/ParenthesisBraceCompletionService.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.BraceCompletion
4343
If skippedTriviaNode IsNot Nothing Then
4444
Dim skippedToken = skippedTriviaNode.ParentTrivia.Token
4545
' These checks don't make any sense. Leaving them in place to avoid breaking something as part of this move.
46-
If skippedToken.Kind <> SyntaxKind.CloseParenToken OrElse Not TypeOf skippedToken.Parent Is BinaryConditionalExpressionSyntax Then
46+
If skippedToken.Kind <> SyntaxKind.CloseParenToken OrElse TypeOf skippedToken.Parent IsNot BinaryConditionalExpressionSyntax Then
4747
Return False
4848
End If
4949
End If

src/Features/VisualBasic/Portable/Completion/CompletionProviders/InternalsVisibleToCompletionProvider.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
3232
Protected Overrides Function GetAssemblyScopedAttributeSyntaxNodesOfDocument(documentRoot As SyntaxNode) As IImmutableList(Of SyntaxNode)
3333
Dim builder As ImmutableList(Of SyntaxNode).Builder = Nothing
3434
Dim compilationUnit = TryCast(documentRoot, CompilationUnitSyntax)
35-
If Not compilationUnit Is Nothing Then
35+
If compilationUnit IsNot Nothing Then
3636
For Each attributeStatement In compilationUnit.Attributes
3737
For Each attributeList In attributeStatement.AttributeLists
3838
builder = If(builder, ImmutableList.CreateBuilder(Of SyntaxNode)())

0 commit comments

Comments
 (0)