Skip to content

Commit 2f84b21

Browse files
committed
QL: add getQueryName to QueryDoc
1 parent 31f7702 commit 2f84b21

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ql/ql/src/codeql_ql/ast/Ast.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ class QueryDoc extends QLDoc {
206206
result = this.getContents().regexpCapture("(?s).*@kind ([\\w-]+)\\s.*", 1)
207207
}
208208

209+
/** Gets the @name for the query */
210+
string getQueryName() {
211+
result = this.getContents().regexpCapture("(?s).*@name ([\\w-\\s]+)(?=\\n).*", 1)
212+
}
213+
209214
/** Gets the id part (without language) of the @id */
210215
string getQueryId() {
211216
result = this.getContents().regexpCapture("(?s).*@id (\\w+)/([\\w\\-]+)\\s.*", 2)

0 commit comments

Comments
 (0)