Skip to content

Recognizing keyword argument in f(x; kwd) #114

@fredcallaway

Description

@fredcallaway

It would be great to tag kwd in the f(x; kwd) be tagged with variable.parameter.julia. I thought it would be pretty simple to recognize the first semicolon and then push a new context which is identical to function-parameters, but where anything tagged as an argument is also tagged as a parameter. But there's some fancy branching stuff going on here that I couldn't grok so I couldn't make it work myself.

Here's a test (which fails)

  bar(x; y, kws...)
#        ^ meta.function-call.arguments.julia variable.parameter.julia

I'm not sure whether kws should be a parameter as well. It is acting as a keyword argument, but it's not actually the name of a parameter. I think it's technically more correct to not tag it, but it would be more practically useful to tag it because from a user perspective, we really just want to know whether the variables are getting passed as keyword arguments or regular arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions