Skip to content

How to use exact and include mode meantime? #34

Description

@cesaryuan

For example, I want the following query

(() => {
    function needExactMatch() {
        var a = 1;
        var a = 2;
    }
})()

to match

(() => {
    OtherStatements1;
    OtherStatements2;
    function needExactMatch() {
        var a = 1;
        var a = 2;
    }
    OtherStatements;
})()

and not match

(() => {
    OtherStatements1;
    OtherStatements2;
    function needExactMatch() {
        OtherStatements;
        var a = 1;
        OtherStatements;
        var a = 2;
        OtherStatements;
    }
    OtherStatements;
})()

Maybe some multiple statements wildcard like $$$$ cound be imported?

So I can use this query in exact mode to achieve this.

(() => {
    $$$$;
    function needExactMatch() {
        var a = 1;
        var a = 2;
    }
    $$$$;
})()

Activity

  1. jayu commented on Dec 21, 2023

    @jayu
    Contributor

    Good use case.

    The problem is that match mode cannot be changed for given query, so it cannot be include for some parts and exact for some other parts.

    I'm working on a feature that I call "Query builder" for now, that will allow for matching code with different match modes, using boolean conditions, matching code in nested scopes etc.

    It's still work in progress, I don't have ETA, but it will definitely support your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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