Skip to content

getUsageOfPattern behaves inconsistently #245

@RunDevelopment

Description

@RunDevelopment

While writing tests, I found that getUsageOfPattern behaves strangely around unknown functions.

The following test cases pass.

{
    code: `foo(/[a-zA-Z]\\w*/)`,
    results: [UsageOfPattern.whole],
},
{
    code: `foo({ pattern: /[a-zA-Z]\\w*/ })`,
    results: [UsageOfPattern.unknown],
},

Both should have the same result: unknown. We do not know how foo is implemented. It might use the regex as is or it might return its source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions