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: TS extension using our file watchers #210687

Closed
3 tasks done
bpasero opened this issue Apr 18, 2024 · 2 comments
Closed
3 tasks done

Test: TS extension using our file watchers #210687

bpasero opened this issue Apr 18, 2024 · 2 comments

Comments

@bpasero
Copy link
Member

bpasero commented Apr 18, 2024

Refs #208872

Complexity: 4

Create Issue


So far, the TS extension implemented file watching on their level, leveraging node.js fs.watch and fs.watchFile. With a new setting, this changes to utilise our vscode.fs.createFileSystemWatcher API that is more performant and matches our built-in file watcher.

TS makes extensive use of file watching for the language services to know what kind of types exist for a project. Watch out for error squiggles and problems reported even though a type you use exists on disk.

Steps:

  • make sure that typescript.tsserver.experimental.useVsCodeWatcher is configured to true
  • use typescript projects as test bed, for example vscode repo itself but also extensions or samples you work on
  • as soon as you open a TS file, the extension will activate and file watchers will install
  • if you configure log level to trace, a new output channel "File Watcher" gives you verbose information and stats
  • do exploratory testing that the TS language services are proper in situation such as:
    • npm install of a new module with types that you reference from your code
    • switching back and forth between branches with differing state of TS types
    • defining a new type in a new file and then using it in another file
    • deleting a file with types that are used
  • open an empty workspace (no folder) and open a TS file (e.g. from VSCode repo) and verify that changes are also picked up in that case for types you reference
  • keep an eye on the window and main logs that the file watcher does not crash or restart
@bpasero bpasero added this to the April 2024 milestone Apr 18, 2024
@alexr00 alexr00 removed their assignment Apr 23, 2024
@paulacamargo25 paulacamargo25 removed their assignment Apr 23, 2024
@karthiknadig
Copy link
Member

I have the log level set to trace:
image

image

I don't see a "File Watcher" channel, I tried reloading as well.
image

@bpasero
Copy link
Member Author

bpasero commented Apr 24, 2024

@karthiknadig you need to set the overall log level to trace, not just for TS 👍

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

No branches or pull requests

5 participants