From 5626427ea520b52d2a6935ed75028be247adba0f Mon Sep 17 00:00:00 2001 From: Rasmus Wriedt Larsen Date: Wed, 23 Feb 2022 13:29:45 +0100 Subject: [PATCH] Python: Add "debug partial flow" snippet --- python/.vscode/ql.code-snippets | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/python/.vscode/ql.code-snippets b/python/.vscode/ql.code-snippets index bd7a3321ca9..3deb61b170e 100644 --- a/python/.vscode/ql.code-snippets +++ b/python/.vscode/ql.code-snippets @@ -250,4 +250,22 @@ ], "description": "API graph .getMember chain (select full path before inserting)", }, + "debug partial flow": { + "scope": "ql", + "prefix": "debug partial flow", + "body": [ + "// put the line below inside the configuration", + "// override int explorationLimit() { result = 5 }", + "// and then run quick evaluation on the predicate below", + "// (and potentially limit the set of sources)", + "predicate debugPartialFlow(Location loc, DataFlow::PartialPathNode node, int dist) {", + " loc = node.getNode().getLocation() and", + " exists(loc.getFile().getRelativePath()) and", + " exists(Configuration config, DataFlow::PartialPathNode source |", + " config.hasPartialFlow(source, node, dist)", + " )", + "}", + ], + "description": "debug partial flow", + }, }