File tree Expand file tree Collapse file tree
lib/codeql/swift/printast
src/queries/ide-contextual-queries Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import swift
66import codeql.swift.generated.ParentChild
77
8+ private newtype TPrintAstConfiguration = TMakePrintAstConfiguration ( )
9+
810/**
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.
1412 */
15- class PrintAstConfiguration extends string {
13+ class PrintAstConfiguration extends TPrintAstConfiguration {
1614 /**
17- * Restrict to a single string, making this a singleton type.
15+ * Gets the string representation of this singleton
1816 */
19- PrintAstConfiguration ( ) { this = "PrintAstConfiguration" }
17+ string toString ( ) { result = "PrintAstConfiguration" }
2018
2119 /**
2220 * 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
1212import IDEContextual
1313
1414/**
15- * The source file to generate an AST from.
15+ * Gets the source file to generate an AST from.
1616 */
1717external string selectedSourceFile ( ) ;
1818
1919class PrintAstConfigurationOverride extends PrintAstConfiguration {
2020 /**
2121 * Holds if the location matches the selected file in the VS Code extension and
22- * the element is `fromSource `.
22+ * the element is `e `.
2323 */
2424 override predicate shouldPrint ( Locatable e ) {
2525 super .shouldPrint ( e ) and
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import codeql.swift.printast.PrintAst
77import TestUtils
88
99/**
10- * Hook to customize the functions printed by this query.
10+ * The hook to customize the entities printed by this query.
1111 */
1212class PrintAstConfigurationOverride extends PrintAstConfiguration {
1313 override predicate shouldPrint ( Locatable e ) { super .shouldPrint ( e ) and toBeTested ( e ) }
You can’t perform that action at this time.
0 commit comments