From 09990f9764308daa5b1ca87f6498a33c6bcf45c3 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Tue, 21 Jul 2020 16:23:20 +0100 Subject: [PATCH] Configure plugin AST printer to ignore comments and only print one file --- ql/src/printAst.ql | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ql/src/printAst.ql b/ql/src/printAst.ql index adc1dd1fb48..e5b36e73fe3 100644 --- a/ql/src/printAst.ql +++ b/ql/src/printAst.ql @@ -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() } }