Skip to content

FileSystemWatcher API to handle changes to files.exclude? #31882

Closed

Description

@mjbvz

From:
#31825
#31822

Problem
The tsconfig.json build task provider currently detects tsconfig.json files in the workspace using findFiles on first run and then using a FileSystemWatcher after wards to keep the list of tsconfig.json up to date. This approach does not handle changes to files.exclude properly.

My current workaround is to only rely on findFiles to pick up the configs. I'm not sure if this will cause performance issues for very large workspaces for users on HDDs compared to the mixed find and watcher approach.

Questions

  • Will findFiles be fast enough on its own for this scenario? I've done basic testing and it seems quick
  • Would there be any other extensions that could benefit from understanding when a file is excluded or included? Should there be an official API for this?

Activity

  1. added
    under-discussion
    on Aug 11, 2017
  2. bpasero commented on Aug 11, 2017

    @bpasero
    Contributor

    I would stay away from a solution that is calling findFiles constantly and rather use the solution of doing an initial scan once and then relying on the file watcher.

    I wonder if we should have an option to respect the files.exclude setting when calling into the file watcher and then leaving out those changes. Or, provide an overload where you can pass in glob patterns to ignore (this would then mean you have to resolve the patterns from the files.exclude setting first and pass it over).

    /cc Johannes Rieken (@jrieken)

  3. jrieken commented on Aug 14, 2017

    @jrieken
    Contributor

    I wonder if we should have an option to respect the files.exclude setting when calling into the file watcher and then leaving out those changes.

    The files.exclude really seems like a UX setting and not something fundamental to the API. Benjamin Pasero (@bpasero) Doesn't glob support negations as we use it our build scripts?

  4. bpasero commented on Aug 15, 2017

    @bpasero
    Contributor

    Yes, normal glob patterns support negations, while the "simple" glob implementation that we have in our core is not supporting that.

  5. joaomoreno commented on Aug 30, 2017

    @joaomoreno
    Contributor

    I just hit a similar issue. The findFiles API respects the settings as well, so I can't go looking for folders called .git in the user's workspace folders. 😢 cc roblourens

  6. jrieken commented on Aug 30, 2017

    @jrieken
    Contributor

    Not cool

  7. bpasero commented on Aug 30, 2017

    @bpasero
    Contributor

    roblourens didn't you make the search viewlet support the case where an include pattern overrules a possible exclude pattern? Is that only for ripgrep? I think for João Moreno (@joaomoreno) case it would be nice to be able to define an include pattern and have it return results even if a configured exclude says otherwise.

  8. jrieken commented on Aug 30, 2017

    @jrieken
    Contributor

    I'd say that is a regression from d618f0da, because extendQuery simply adds exclude params. I'll extract this to another issue

  9. bpasero commented on Aug 30, 2017

    @bpasero
    Contributor

    Ok I was not aware the previously we would not add the standard configured excludes to this API call.

  10. jrieken commented on Aug 30, 2017

    @jrieken
    Contributor

    Yeah, at least that is my firm believe. The change added the extendQuery-call, unless that was extracted from the search-call (which I don't think)...

  11. roblourens commented on Aug 30, 2017

    @roblourens
    Member

    The extendQuery call was put there because I removed it from SearchService.search. Are you sure it didn't use those excludes previously? Here is a point when it was still there: https://github.com/Microsoft/vscode/blob/3800e5ec4074e1d8510037f8ce8f2b746ac48940/src/vs/workbench/services/search/node/searchService.ts#L63

  12. roblourens commented on Aug 30, 2017

    @roblourens
    Member

    roblourens didn't you make the search viewlet support the case where an include pattern overrules a possible exclude pattern? Is that only for ripgrep?

    That didn't really pan out

  13. jrieken commented on Aug 30, 2017

    @jrieken
    Contributor

    Are you sure it didn't use those excludes previously?

    Not sure, it is some years ago... I believe it shouldn't pick up the defaults without users opting in to it...

  14. roblourens commented on Aug 30, 2017

    @roblourens
    Member

    In 1.14.2, I see it using these by default. I don't think we should search .git and node_modules for every findFiles call by default, because that can take a long time. But I'm open to providing a way to turn that off or override it.

  15. bpasero commented on Aug 31, 2017

    @bpasero
    Contributor

    I also think we should be careful about changing the defaults for performance reasons. roblourens are we using ripgrep for the findFiles call or our old slow find mechanism?

  16. jrieken commented on Aug 31, 2017

    @jrieken
    Contributor

    roblourens Benjamin Pasero (@bpasero) Please discuss findFiles issues here: #33528. This item is about file watching.

  17. removed this from the Backlog milestone on Nov 15, 2017
  18. removed their assignment
    on Sep 12, 2018
  19. added
    *out-of-scope
    on Oct 7, 2019
  20. vscodebot commented on Oct 7, 2019

    @vscodebot

    This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

    If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

    Thanks for your understanding and happy coding!

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

Metadata

Metadata

Labels

*out-of-scopeapifile-watcherunder-discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions