Skip to content

file watcher improve #523

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

Closed
kikyous opened this issue Sep 24, 2021 · 2 comments
Closed

file watcher improve #523

kikyous opened this issue Sep 24, 2021 · 2 comments

Comments

@kikyous
Copy link

kikyous commented Sep 24, 2021

yesterday I found change vs code settings to use fs events can stop volar polling fs files.

"typescript.tsserver.watchOptions": {
    "watchDirectory": "useFsEvents",
    "watchFile": "useFsEvents",
    "useFsEvents": true,
    "usePolling": false
}

#507 (comment)

But it seems not work when I restart vscode.

I don't know much about lsp, but from https://code.visualstudio.com/api/language-extensions/language-server-extension-guide#implementing-a-language-server, there is some built in event we can use (maybe):

connection.onDidChangeWatchedFiles(_change => {
  // Monitored files have change in VS Code
  connection.console.log('We received a file change event');
});

Vetur use this event too:
https://github.com/vuejs/vetur/blob/HEAD/server/src/services/vls.ts#L474

Can volar use this ?

@johnsoncodehk
Copy link
Member

Yes we can try this.

@johnsoncodehk johnsoncodehk added the enhancement New feature or request label Sep 24, 2021
@kikyous
Copy link
Author

kikyous commented Sep 24, 2021

I found some issues in vetur maybe useful to you.
vuejs/vetur#355
vuejs/vetur@6ef2132

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

2 participants