Skip to content

Since 1.94 the Find widget on Explorer no longer works for a FileSystemProvider-implemented folder unless FileSearchProvider is also implemented #230483

Closed

Description

Type: Bug

A significant problem of this regression is that FileSearchProvider API is still in proposed state.

Repro steps:

  1. Clone https://github.com/microsoft/vscode-extension-samples
  2. Open its fsprovider-sample folder.
  3. Build and run the extension.
  4. In the EH, use the MemFS commands in Command Palette to Setup Workspace and then Create Files.
  5. On Explorer, open the Find widget and try to use it.

You get an endless progress bar because of this line in VS Code's SearchService:

this.logService.warn(`No search provider registered for scheme: ${scheme}, waiting`);

VS Code version: Code 1.94.0 (d78a74b, 2024-10-02T13:08:12.626Z)
OS version: Windows_NT x64 10.0.22631
Modes:

Activity

  1. gjsjohnmurray commented on Oct 4, 2024

    @gjsjohnmurray
    ContributorAuthor
  2. gjsjohnmurray commented on Oct 4, 2024

    @gjsjohnmurray
    ContributorAuthor

    Related to this, the FileSearchProvider doesn't get informed about shouldGlobMatchFilepattern. It has to infer this from the shape of filePattern

    shouldGlobMatchFilePattern: !isFuzzyMatch,
    filePattern: isFuzzyMatch ? pattern : `**/*${pattern}*`,
    maxResults: 512,

  3. andreamah commented on Oct 4, 2024

    @andreamah
    Contributor

    I can't seem to repro this on insiders. Benjamin Christopher Simmonds (@benibenj) did you recently adopt file searching from the search service? And if so, is it behind a feature flag?

  4. gjsjohnmurray commented on Oct 4, 2024

    @gjsjohnmurray
    ContributorAuthor

    Andrea Mah (@andreamah) when trying to repro it with fsprovider-sample make sure you don't have any folders open in the EH when you run MemFS: Setup Workspace

  5. andreamah commented on Oct 4, 2024

    @andreamah
    Contributor

    Okay I see it now. I see that we have a check where, if there is just one provider type that we are looking for, we wait for it. However, in this case, it isn't being registered. We probably do this because we need to wait for extensions to register their providers.

    I could add a flag (or a list of provider schemes) in settings for not waiting for search providers that aren't registered, and this would be temporary until we finalize the API. Does that sound reasonable?

    I was originally thinking about a timeout, but it can sometimes take a while for providers to get registered (especially on startup). If we have a setting, people who know that they don't need to wait will not have to wait.

  6. added
    bug
    confirmed
    on Oct 4, 2024
  7. gjsjohnmurray commented on Oct 4, 2024

    @gjsjohnmurray
    ContributorAuthor

    I would prefer that Explorer Find reverted to its old way of finding if there's no applicable FileSearchProvider available (either because it hasn't yet registered or because none is implemented). As things stand, users of our FileSystemProvider have lost all search/filter capabilities in the Explorer tree unless they are willing to jump through the extra hoops to use a build that implements the still-proposed FileSearchProvider API. This feels like a regression.

  8. andreamah commented on Oct 4, 2024

    @andreamah
    Contributor

    Benjamin Christopher Simmonds (@benibenj) would you be open to calling an arg on SearchService to not wait for providers that haven't been registered yet? The implication is that, on platforms like vscode.dev that have a custom search provider, you might get no results if the search provider hasn't been registered yet.

  9. benibenj commented on Oct 5, 2024

    @benibenj
    Contributor

    Andrea Mah (@andreamah) is it possible to tell if there is a File Search Provider available for a given scheme?

  10. benibenj commented on Oct 5, 2024

    @benibenj
    Contributor

    I suggest creating a candidate for this. To keep this simple I propose that the explorer checks if the resource scheme of the root(s) is 'file'. If that is not the case, we revert back to the old behaviour. I still need to check other potential schemes to include too.

    For insiders:

    • It would be great to have a way to tell if there is a search provider available or not for a given scheme, so we know which find behaviour to pick.
    • Regarding the fuzzy toggle, we could remove it for search providers provided by extensions until the API gets finalized.
  11. added
    candidate
    on Oct 5, 2024
  12. 9 remaining items

  13. rzhao271 commented on Oct 9, 2024

    @rzhao271
    Collaborator

    I still see the issue on the latest Stable RC while following the original repro steps.
    Re-opening.
    Infinite progress bar with message saying memfs has no search provider registered

  14. added
    verification-found
    and removed
    verified
    on Oct 9, 2024
  15. benibenj commented on Oct 10, 2024

    @benibenj
    Contributor

    The warning seems to be triggered by the search view and not the explorer search.

  16. bpasero commented on Oct 10, 2024

    @bpasero
    Contributor

    I can still reproduce an endless progress spinner following the exact same steps in #230483 (comment). Maybe John Murray (@gjsjohnmurray) could also test with our 1.94.2 release candidate (Download) if something improved for him.

  17. gjsjohnmurray commented on Oct 10, 2024

    @gjsjohnmurray
    ContributorAuthor

    Benjamin Pasero (@bpasero) I will check that RC and report back here ASAP

  18. gjsjohnmurray commented on Oct 10, 2024

    @gjsjohnmurray
    ContributorAuthor

    I have verified that the recovery fix by Benjamin Christopher Simmonds (@benibenj) is good. For a workspace using our FileSystemProvider the Explorer Find widget no longer produces a constant clock badge and progress bar on the Explorer icon in Activity Bar.

    In Search view there's a constant clock badge and progress bar, but I don't think that was new in 1.94. Andrea Mah (@andreamah) should be able to confirm that the way Search waits (in vain) indefinitely for a TextSearchProvider to get registered for the only scheme involved in my workspace (from an extension-contributed FSP) was happening prior to 1.94. Even if it was new in 1.94 it's a separate (though related) issue that IMO shouldn't delay shipping 1.94.2.

  19. bpasero commented on Oct 10, 2024

    @bpasero
    Contributor

    John Murray (@gjsjohnmurray) I can still reproduce your original issue when you are in a multi-root workspace where 1 folder is local and 1 is from the memory-fs provider, so maybe that explains the difference in testing outcome.

    If there is just 1 memory-fs provided folder in the explorer, I can see that the fix seems to be working.

    Image

    Can you test?

  20. locked and limited conversation to collaborators on Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcandidateconfirmedverified

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions