mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
All languages: Add getPrimaryQlClasses()
This is a non-overridable predicate that concatenates all the getAPrimaryQlClass() results into a comma-separated string.
This commit is contained in:
@@ -132,6 +132,11 @@ class Locatable extends @locatable {
|
||||
none()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 primary QL class for the Locatable.
|
||||
*/
|
||||
|
||||
@@ -44,9 +44,9 @@ private predicate isNotNeeded(Locatable el) {
|
||||
* Retrieves the canonical QL class(es) for entity `el`
|
||||
*/
|
||||
private string getQlClass(Locatable el) {
|
||||
result = "[" + concat(el.getAPrimaryQlClass(), ",") + "] "
|
||||
result = "[" + el.getPrimaryQlClasses() + "] "
|
||||
// Alternative implementation -- do not delete. It is useful for QL class discovery.
|
||||
// not el.getAPrimaryQlClass() = "???" and result = "[" + concat(el.getAPrimaryQlClass(), ",") + "] " or el.getAPrimaryQlClass() = "???" and result = "??[" + concat(el.getAQlClass(), ",") + "] "
|
||||
// not el.getAPrimaryQlClass() = "???" and result = "[" + getPrimaryQlClasses() + "] " or el.getAPrimaryQlClass() = "???" and result = "??[" + concat(el.getAQlClass(), ",") + "] "
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user