File tree Expand file tree Collapse file tree 3 files changed +795
-27
lines changed
src/queries/ide-contextual-queries Expand file tree Collapse file tree 3 files changed +795
-27
lines changed Original file line number Diff line number Diff line change 10
10
import swift
11
11
import codeql.swift.printast.PrintAst
12
12
import IDEContextual
13
+ import codeql.swift.generated.ParentChild
13
14
14
15
/**
15
16
* Gets the source file to generate an AST from.
@@ -23,6 +24,10 @@ class PrintAstConfigurationOverride extends PrintAstConfiguration {
23
24
*/
24
25
override predicate shouldPrint ( Locatable e ) {
25
26
super .shouldPrint ( e ) and
26
- e .getFile ( ) = getFileBySourceArchiveName ( selectedSourceFile ( ) )
27
+ (
28
+ e .getFile ( ) = getFileBySourceArchiveName ( selectedSourceFile ( ) )
29
+ or
30
+ exists ( Locatable parent | this .shouldPrint ( parent ) and parent = getImmediateParent ( e ) )
31
+ )
27
32
}
28
33
}
Original file line number Diff line number Diff line change 1
1
private import codeql.swift.elements
2
+ private import codeql.swift.generated.ParentChild
2
3
3
4
cached
4
5
predicate toBeTested ( Element e ) {
5
6
e instanceof File
6
7
or
7
- e instanceof AppliedPropertyWrapperExpr
8
- or
9
8
exists ( ModuleDecl m |
10
9
m = e and
11
10
not m .isBuiltinModule ( ) and
@@ -32,6 +31,8 @@ predicate toBeTested(Element e) {
32
31
e .( UnspecifiedElement ) .getParent ( ) = tested
33
32
or
34
33
e .( OpaqueTypeDecl ) .getNamingDeclaration ( ) = tested
34
+ or
35
+ tested = getImmediateParent ( e )
35
36
)
36
37
)
37
38
}
You can’t perform that action at this time.
0 commit comments