-
Notifications
You must be signed in to change notification settings - Fork 37
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
♻️ Use LSP based file watcher #1610
base: main
Are you sure you want to change the base?
Conversation
During testing I noticed there was a bug with VS Code's built-in file watcher:
Expected Results: Raw LSP changes should include {
changes: [
{
uri: 'file:///a2/b/c2',
type: 1
},
{
uri: 'file:///a2/b/c',
type: 3
}
]
} Actual Results: Raw LSP changes instead include {
changes: [
{
uri: 'file:///a/b/c2',
type: 1
},
{
uri: 'file:///a/b/c',
type: 3
}
]
} Notice that folder |
@SPGoding During testing I could not reproduce this issue. I correctly get the addition of Regardless of me being able to reproduce, is this a blocking issue meaning we can't go forward with this LSP based watcher approach? Or are there workarounds to resolve this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to solving the renaming bug on Windows, this also seems to greatly improve performance! While before it would take upwards of 60 seconds to load the Gamemode 4 repo (cached), it now only takes 16 seconds!
I experienced one issue when deleting a very large folder, with a OOM crash.
const watcherDisposable = await connection.client.register( | ||
ls.DidChangeWatchedFilesNotification.type, | ||
{ | ||
watchers: [{ globPattern: '**/*' }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #1607 Afro started working on being able to exclude certain patterns from the watcher. From testing, the watcher seems to be very performant so this may not be necessary, but I did see raw LSP changes in .git/FETCH_HEAD
for example. Do these have potential to break anything? If we want to do any filtering, should we do it here or later in LspFsWatcher.onLspDidChangeWatchedFiles
?
I don't think this is a blocking issue. I do think it'd be nice if we can fix the OOM problems first though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this on a simple data pack and I encountered issues where symbols were not updating when I created/renamed/deleted json files. I found one part of the issue so now new json files show up as symbols.
But deleting or renaming a json file still leaves the old symbol as a definition in the symbol table. I tried doing some debugging but couldn't immediately spot the issue. SymbolUtil.removeLocationsFromSymbol
seems to be correctly removing the location, but then trim
thinks that the symbol is not trimmable.
Thanks for testing. I think I know what's the problem. I'll let you know after I fix it and do some more testing on my own. |
Resolves #1414.
For testing purposes, the Output tab includes outputs prefixed with
[FsWatcher]
with the raw LSP changes, added files, changed files, and unlinked files, whenever file system changes are detected.