@@ -28,7 +28,7 @@ export class ObjectScriptCodeLensProvider implements vscode.CodeLensProvider {
28
28
return result ;
29
29
}
30
30
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;
32
32
let inComment = false ;
33
33
for ( let i = 0 ; i < document . lineCount ; i ++ ) {
34
34
const line = document . lineAt ( i ) ;
@@ -47,17 +47,23 @@ export class ObjectScriptCodeLensProvider implements vscode.CodeLensProvider {
47
47
48
48
const methodMatch = text . match ( pattern ) ;
49
49
if ( methodMatch ) {
50
- const [ , name , paramsRaw ] = methodMatch ;
50
+ const [ , kind , name , paramsRaw ] = methodMatch ;
51
51
let params = paramsRaw ;
52
52
params = params . replace ( / " [ ^ " ] * " / g, '""' ) ;
53
53
params = params . replace ( / { [ ^ { } ] * } | { [ ^ { } ] * { [ ^ { } ] * } [ ^ { } ] * } / g, '""' ) ;
54
54
params = params . replace ( / \( [ ^ ( ) ] * \) / g, "" ) ;
55
55
const args = params . split ( ")" ) [ 0 ] ;
56
56
const paramsCount = args . length ? args . split ( "," ) . length : params . includes ( ")" ) ? 0 : 1 ; // Need a positive paramsCount when objectscript.multilineMethodArgs is true
57
57
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 ] ) ) ;
59
63
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
+ ) ;
61
67
}
62
68
}
63
69
return result ;
0 commit comments