@@ -28,7 +28,7 @@ export class ObjectScriptCodeLensProvider implements vscode.CodeLensProvider {
2828 return result ;
2929 }
3030
31- const pattern = / (?: ^ C l a s s M e t h o d \s ) ( [ ^ ( ] + ) \( ( .* ) / i;
31+ const pattern = / (?: ^ ( C l a s s M e t h o d | Q u e r y ) \s ) ( [ ^ ( ] + ) \( ( .* ) / i;
3232 let inComment = false ;
3333 for ( let i = 0 ; i < document . lineCount ; i ++ ) {
3434 const line = document . lineAt ( i ) ;
@@ -47,17 +47,23 @@ export class ObjectScriptCodeLensProvider implements vscode.CodeLensProvider {
4747
4848 const methodMatch = text . match ( pattern ) ;
4949 if ( methodMatch ) {
50- const [ , name , paramsRaw ] = methodMatch ;
50+ const [ , kind , name , paramsRaw ] = methodMatch ;
5151 let params = paramsRaw ;
5252 params = params . replace ( / " [ ^ " ] * " / g, '""' ) ;
5353 params = params . replace ( / { [ ^ { } ] * } | { [ ^ { } ] * { [ ^ { } ] * } [ ^ { } ] * } / g, '""' ) ;
5454 params = params . replace ( / \( [ ^ ( ) ] * \) / g, "" ) ;
5555 const args = params . split ( ")" ) [ 0 ] ;
5656 const paramsCount = args . length ? args . split ( "," ) . length : params . includes ( ")" ) ? 0 : 1 ; // Need a positive paramsCount when objectscript.multilineMethodArgs is true
5757
58- debugThisMethod && result . push ( this . addDebugThisMethod ( i , [ `##class(${ className } ).${ name } ` , paramsCount > 0 ] ) ) ;
58+ const methodName = name + ( kind == "Query" ? "Func" : "" ) ;
59+
60+ debugThisMethod &&
61+ kind == "ClassMethod" &&
62+ result . push ( this . addDebugThisMethod ( i , [ `##class(${ className } ).${ methodName } ` , paramsCount > 0 ] ) ) ;
5963 copyToClipboard &&
60- result . push ( this . addCopyToClipboard ( i , [ `##class(${ className } ).${ name } (${ Array ( paramsCount ) . join ( "," ) } )` ] ) ) ;
64+ result . push (
65+ this . addCopyToClipboard ( i , [ `##class(${ className } ).${ methodName } (${ Array ( paramsCount ) . join ( "," ) } )` ] )
66+ ) ;
6167 }
6268 }
6369 return result ;
0 commit comments