Configure plugin AST printer to ignore comments and only print one file

This commit is contained in:
Chris Smowton
2020-07-21 16:23:20 +01:00
parent b8c4004c59
commit 09990f9764

View File

@@ -20,7 +20,9 @@ external string selectedSourceFile();
* Hook to customize the functions printed by this query.
*/
class Cfg extends PrintAstConfiguration {
override predicate shouldPrintFunction(FuncDef func) {
func.getFile() = getEncodedFile(selectedSourceFile())
}
override predicate shouldPrintFunction(FuncDef func) { shouldPrintFile(func.getFile()) }
override predicate shouldPrintFile(File file) { file = getEncodedFile(selectedSourceFile()) }
override predicate shouldPrintComments(File file) { none() }
}