mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
QL: Remove getAMember from getAChild
Adds `getAQLDocComment` for accessing those module members that are simply QLDoc comments (apart from the one that applies to the module itself, which is still accessed through `getQLDoc`.)
This commit is contained in:
@@ -84,11 +84,18 @@ class TopLevel extends TTopLevel, AstNode {
|
||||
/** Gets a top-level predicate in this module. */
|
||||
ClasslessPredicate getAPredicate() { result = this.getAMember() }
|
||||
|
||||
/**
|
||||
* Gets a QLDoc comment for a top-level entity in this module.
|
||||
*
|
||||
* Use `getQLDoc` if you want the QLDoc for the module itself.
|
||||
*/
|
||||
QLDoc getAQLDocComment() { result = getQLDocFor(_) }
|
||||
|
||||
/** Gets a module defined at the top-level module of this module. */
|
||||
Module getAModule() { result = this.getAMember() }
|
||||
|
||||
override ModuleMember getAChild(string pred) {
|
||||
pred = directMember("getAMember") and result = this.getAMember()
|
||||
pred = directMember("getAQLDocComment") and result = this.getAQLDocComment()
|
||||
or
|
||||
pred = directMember("getQLDoc") and result = this.getQLDoc()
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user