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 {
186
186
override string getAPrimaryQlClass ( ) { result = "QueryDoc" }
187
187
188
188
/** 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
+ }
190
192
191
193
/** Gets the id part (without language) of the @id */
192
194
string getQueryId ( ) {
@@ -242,6 +244,12 @@ class Select extends TSelect, AstNode {
242
244
*/
243
245
Expr getExpr ( int i ) { toQL ( result ) = sel .getChild ( _) .( QL:: AsExprs ) .getChild ( i ) }
244
246
247
+ Expr getMessage ( ) {
248
+ if this .getQueryDoc ( ) .getQueryKind ( ) = "path-problem"
249
+ then result = this .getExpr ( 3 )
250
+ else result = this .getExpr ( 1 )
251
+ }
252
+
245
253
// TODO: This gets the `i`th order-by, but some expressions might not have an order-by.
246
254
Expr getOrderBy ( int i ) { toQL ( result ) = sel .getChild ( _) .( QL:: OrderBys ) .getChild ( i ) .getChild ( 0 ) }
247
255
You can’t perform that action at this time.
0 commit comments