Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: new file watcher #135653

Closed
4 tasks done
bpasero opened this issue Oct 22, 2021 · 3 comments
Closed
4 tasks done

Test: new file watcher #135653

bpasero opened this issue Oct 22, 2021 · 3 comments

Comments

@bpasero
Copy link
Member

bpasero commented Oct 22, 2021

Refs: #132483

Complexity: 5

Create Issue


The file watcher (parcel-watcher) is the new standard file watcher for all platforms, including remote setups. Besides changing the watcher itself, it was also moved to be under the shared process (unless you use remote). If you encounter weirdness, make sure to also check in the shared process dev tools ("Developer: Toggle Shared Process").

Setup: best to test this on a larger code base (like VSCode itself) and doing changes not only in root but also in deep hierarchies. In order to diagnose issues you can:

  • run code-insiders --verbose
  • filter the Console by putting parcel into the filter
  • monitor the output: you will see every raw file event reported from the parcel library and a normalised event signalling the event that is actually being sent to VSCode (for remote, this will appear in the remote server logs and can be enabled dynamically by changing the log level from F1 palette)

image

IMPORTANT: over the years we have built a lot of measures to workaround missing file events making it actually a bit harder to test the functionality of these events. As such:

  • never do a file modification in the same VSCode window that you observe because when e.g. deleting a file using VSCode explorer, we remove it instantly knowing that it was deleted
  • even when you do a change outside of the VSCode window, make sure to observe the change in the window without moving focus into the window - we refresh the explorer and opened editors when that happens assuming there was a change

Testing Events

  • basic operations are reflected in the VSCode explorer when done from a VSCode explorer in another window
    • file/folder create
    • file/folder delete
    • file/folder move
    • file/folder rename
    • file/folder copy
  • the same is true when doing these operations from the native OS explorer (e.g. Windows explorer, macOS Finder)
  • changes to files are reflected in the editor if the file is opened in the editor

Testing Robustness

  • even under large pressure the watching never stops working (e.g. large npm install or git operation) - monitor devtools output for information in case it stops working
  • macOS/Linux: delete the folder that you opened as workspace and bring it back and verify the file watcher continues to work without window reload
  • Linux: configure a low fs.inotify.max_user_watches (instructions), restart and open a large folder with VSCode and verify you see a warning notification telling you how to increase that limit

Testing Settings

  • ensure you have a folder in your workspace that is a symbolic link to a folder outside the workspace and use the new files.watcherInclude setting to enable it for watching and verify that works
  • ensure you can exclude folders in your workspace from being watched via the files.watcherExclude setting
  • ensure you can force to use our old watcher when configuring files.legacyWatcher: "on". if you run with --verbose and search for "watcher", the name of the watcher will be printed (chokidar for Linux and nsfw for macOS/Windows)
@bpasero bpasero added this to the October 2021 milestone Oct 22, 2021
@jrieken jrieken removed their assignment Oct 26, 2021
@DonJayamanne
Copy link
Contributor

@bpasero Already loving this, I create a lot of Python virtual environments and end up having to refresh the explorer view to see it, just tried this and works like a charm in WSL.
Will test on mac as per the test plan item, thought I'd mention how well its working and the fact that its already very useful for my workflow.

@DonJayamanne
Copy link
Contributor

Works very well, this is what I tried:

  • Added a symbolic link to vscode-jupyter repo inside vscode repo
  • Clone the vscode-jupyter repo inside vscode repo
  • Refactored some code (add/edit,delete, etc)
  • Creating virtual environments & installing packages (much like npm install)

@bpasero
Copy link
Member Author

bpasero commented Oct 27, 2021

@DonJayamanne thanks for covering WSL as well 👍

@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants