File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,14 +84,14 @@ public override async Task<CSharpSyntaxNode> VisitCompilationUnit(VBSyntax.Compi
8484 var options = ( VBasic . VisualBasicCompilationOptions ) _semanticModel . Compilation . Options ;
8585 var importsClauses = options . GlobalImports . Select ( gi => gi . Clause ) . Concat ( node . Imports . SelectMany ( imp => imp . ImportsClauses ) ) . ToList ( ) ;
8686
87- var optionCompareText = node . Options . Any ( x => x . NameKeyword . ValueText . Equals ( "Compare" , StringComparison . OrdinalIgnoreCase ) &&
88- x . ValueKeyword . ValueText . Equals ( "Text" , StringComparison . OrdinalIgnoreCase ) ) ;
8987 _topAncestorNamespace = node . Members . Any ( m => ! IsNamespaceDeclaration ( m ) ) ? options . RootNamespace : null ;
90- _visualBasicEqualityComparison . OptionCompareTextCaseInsensitive = optionCompareText ;
88+ var fileOptionCompareValue = node . Options . Where ( x => x . NameKeyword . IsKind ( VBasic . SyntaxKind . CompareKeyword ) ) . LastOrDefault ( ) ? . ValueKeyword ;
89+ _visualBasicEqualityComparison . OptionCompareTextCaseInsensitive = fileOptionCompareValue ? . IsKind ( VBasic . SyntaxKind . TextKeyword ) ?? options . OptionCompareText ;
9190
9291 var attributes = SyntaxFactory . List ( await node . Attributes . SelectMany ( a => a . AttributeLists ) . SelectManyAsync ( CommonConversions . ConvertAttributeAsync ) ) ;
92+
9393 var sourceAndConverted = await node . Members
94- . Where ( m => ! ( m is VBSyntax . OptionStatementSyntax ) ) //TODO Record values for use in conversion
94+ . Where ( m => ! ( m is VBSyntax . OptionStatementSyntax ) )
9595 . SelectAsync ( async m => ( Source : m , Converted : await ConvertMemberAsync ( m ) ) ) ;
9696
9797
You can’t perform that action at this time.
0 commit comments