File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
extensions/ql-vscode/src/model-editor/languages/python Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -177,16 +177,26 @@ export const python: ModelsAsDataLanguage = {
177177 // Argument and Parameter are equivalent in Python, but we'll use Argument in the model editor
178178 const argumentsList = getArgumentsList ( method . methodParameters ) . map (
179179 ( argument , index ) : MethodArgument => {
180+ // Keyword-only arguments end with `:` in the query
180181 if ( argument . endsWith ( ":" ) ) {
181182 return {
182183 path : `Argument[${ argument } ]` ,
183184 label : `Argument[${ argument } ]` ,
184185 } ;
185186 }
186187
188+ // Positional-only arguments end with `/` in the query
189+ if ( argument . endsWith ( "/" ) ) {
190+ return {
191+ path : `Argument[${ index } ]` ,
192+ label : `Argument[${ index } ]: ${ argument . substring ( 0 , argument . length - 1 ) } ` ,
193+ } ;
194+ }
195+
196+ // All other arguments are both keyword and positional
187197 return {
188- path : `Argument[${ index } ]` ,
189- label : `Argument[${ index } ]: ${ argument } ` ,
198+ path : `Argument[${ index } , ${ argument } : ]` ,
199+ label : `Argument[${ index } , ${ argument } : ]: ${ argument } ` ,
190200 } ;
191201 } ,
192202 ) ;
You can’t perform that action at this time.
0 commit comments