Merge pull request #568 from igfoo/igfoo/getPrimaryQlClasses

Add getPrimaryQlClasses()
This commit is contained in:
Chris Smowton
2021-08-24 14:13:50 +01:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
lgtm,codescanning
* Added `AstNode.getPrimaryQlClasses()` predicate, which gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.

View File

@@ -81,6 +81,11 @@ class AstNode extends @node, Locatable {
/** Gets the innermost function definition to which this AST node belongs, if any. */
FuncDef getEnclosingFunction() { result = getParent().parentInSameFunction*() }
/**
* Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.
*/
final string getPrimaryQlClasses() { result = concat(getAPrimaryQlClass(), ",") }
/**
* Gets the name of a primary CodeQL class to which this node belongs.
*