Skip to content

WorkspaceSearchProvider always does regex search #756

@nk-coding

Description

@nk-coding

Hi,
I use the search service override with the WorkspaceSearchProvider. However, if I set isRegExp: false, it still performs regex search. This can also be seen in the hosted demo of this project, e.g., by searching for ... with regex disabled (basically matches a lot is should not).

I belive the reason for this is how the search regex is created in createSerachRegex does not do any regex escaping.

I belive that this can be fixed by doing escaping similar to how vscode does it in createRegExp which is called by createSearchRegExp of their localFileSearch.ts.
Maybe it would be an option to just call the createRegExp function like vscode does? If not, I think the escaping using escapeRegExpCharacters should also do the job. However I did not test any of these options yet.

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