File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,9 @@ class QueryDoc extends QLDoc {
186186 override string getAPrimaryQlClass ( ) { result = "QueryDoc" }
187187
188188 /** Gets the @kind for the query */
189- string getQueryKind ( ) { result = this .getContents ( ) .regexpCapture ( "(?s).*@kind (\\w+)\\s.*" , 1 ) }
189+ string getQueryKind ( ) {
190+ result = this .getContents ( ) .regexpCapture ( "(?s).*@kind ([\\w-]+)\\s.*" , 1 )
191+ }
190192
191193 /** Gets the id part (without language) of the @id */
192194 string getQueryId ( ) {
@@ -242,6 +244,12 @@ class Select extends TSelect, AstNode {
242244 */
243245 Expr getExpr ( int i ) { toQL ( result ) = sel .getChild ( _) .( QL:: AsExprs ) .getChild ( i ) }
244246
247+ Expr getMessage ( ) {
248+ if this .getQueryDoc ( ) .getQueryKind ( ) = "path-problem"
249+ then result = this .getExpr ( 3 )
250+ else result = this .getExpr ( 1 )
251+ }
252+
245253 // TODO: This gets the `i`th order-by, but some expressions might not have an order-by.
246254 Expr getOrderBy ( int i ) { toQL ( result ) = sel .getChild ( _) .( QL:: OrderBys ) .getChild ( i ) .getChild ( 0 ) }
247255
You can’t perform that action at this time.
0 commit comments