File tree Expand file tree Collapse file tree 4 files changed +31
-0
lines changed
csharp/ql/test/library-tests/csharp10/global Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ global using System ;
2
+ global using System . IO ;
3
+ global using static System . Text . Encoding ;
Original file line number Diff line number Diff line change
1
+ using System . Collections ;
2
+
3
+ public class MyClass1
4
+ {
5
+ public void HelloWorld ( )
6
+ {
7
+ Console . WriteLine ( "Hello World" ) ;
8
+ }
9
+ }
Original file line number Diff line number Diff line change
1
+ globalUsing
2
+ | GlobalUsing.cs:1:1:1:20 | using ...; |
3
+ | GlobalUsing.cs:2:1:2:23 | using ...; |
4
+ | GlobalUsing.cs:3:1:3:41 | using static ...; |
5
+ localUsing
6
+ | MyClass1.cs:1:1:1:25 | using ...; |
7
+ globalUsingNamespace
8
+ | GlobalUsing.cs:1:1:1:20 | using ...; | file://:0:0:0:0 | System |
9
+ | GlobalUsing.cs:2:1:2:23 | using ...; | file://:0:0:0:0 | System.IO |
Original file line number Diff line number Diff line change
1
+ import csharp
2
+
3
+ query predicate globalUsing ( UsingDirective und ) { und .isGlobal ( ) }
4
+
5
+ query predicate localUsing ( UsingDirective ud ) { not ud .isGlobal ( ) }
6
+
7
+ query predicate globalUsingNamespace ( UsingNamespaceDirective und , Namespace namespace ) {
8
+ und .isGlobal ( ) and
9
+ namespace = und .getImportedNamespace ( )
10
+ }
You can’t perform that action at this time.
0 commit comments