File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
lib/codeql/swift/printast
src/queries/ide-contextual-queries Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 5
5
import swift
6
6
import codeql.swift.generated.ParentChild
7
7
8
+ private newtype TPrintAstConfiguration = TMakePrintAstConfiguration ( )
9
+
8
10
/**
9
- * Hook to customize the files and functions printed by this module.
10
- *
11
- * For an AstNode to be printed, it always requires `shouldPrintFile(f)` to hold
12
- * for its containing file `f`, and additionally requires `shouldPrintFunction(fun)`
13
- * to hold if it is, or is a child of, function `fun`.
11
+ * The hook to customize the files and functions printed by this module.
14
12
*/
15
- class PrintAstConfiguration extends string {
13
+ class PrintAstConfiguration extends TPrintAstConfiguration {
16
14
/**
17
- * Restrict to a single string, making this a singleton type.
15
+ * Gets the string representation of this singleton
18
16
*/
19
- PrintAstConfiguration ( ) { this = "PrintAstConfiguration" }
17
+ string toString ( ) { result = "PrintAstConfiguration" }
20
18
21
19
/**
22
20
* Holds if the AST for `e` should be printed. By default, holds for all.
Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ import codeql.swift.printast.PrintAst
12
12
import IDEContextual
13
13
14
14
/**
15
- * The source file to generate an AST from.
15
+ * Gets the source file to generate an AST from.
16
16
*/
17
17
external string selectedSourceFile ( ) ;
18
18
19
19
class PrintAstConfigurationOverride extends PrintAstConfiguration {
20
20
/**
21
21
* Holds if the location matches the selected file in the VS Code extension and
22
- * the element is `fromSource `.
22
+ * the element is `e `.
23
23
*/
24
24
override predicate shouldPrint ( Locatable e ) {
25
25
super .shouldPrint ( e ) and
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import codeql.swift.printast.PrintAst
7
7
import TestUtils
8
8
9
9
/**
10
- * Hook to customize the functions printed by this query.
10
+ * The hook to customize the entities printed by this query.
11
11
*/
12
12
class PrintAstConfigurationOverride extends PrintAstConfiguration {
13
13
override predicate shouldPrint ( Locatable e ) { super .shouldPrint ( e ) and toBeTested ( e ) }
You can’t perform that action at this time.
0 commit comments