-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix: Trigger watch event on file change #30
Fix: Trigger watch event on file change #30
Conversation
workspace.createFileSystemWatcher('**/*.bb', false, true, false), | ||
workspace.createFileSystemWatcher('**/*.conf', false, true, false) | ||
workspace.createFileSystemWatcher('**/*.bbclass', false, false, false), | ||
workspace.createFileSystemWatcher('**/*.inc', false, false, false), |
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 think I've seen that the watcher event runs rescan-project instead of just parsing. rescan would be too slow for file changes IMO.
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.
From my observation, I have seen multiple parses on a single file save but I didn't see it triggered scan.
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.
Elinor has had trouble with the watcher events. I think that if it's not properly configured, it will infinetely keep parsing/scanning. On disk changes should not happen in any uncontrolled manner in our workflows. I wonder if we shouldn't just drop any kind of file watch?
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.
There is some code for embedded languages in the watch function. If we are worried about the parse/scan, we can remove the function call to parse and figure out something else to trigger it.
workspace.createFileSystemWatcher('**/*.bbclass', false, false, false), | ||
workspace.createFileSystemWatcher('**/*.inc', false, false, false), | ||
workspace.createFileSystemWatcher('**/*.bb', false, false, false), | ||
workspace.createFileSystemWatcher('**/*.conf', false, false, false) |
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.
This feature should be configurable and also not run if settings are not sane. Look for the mecanisms for this in server.ts on file save and make sure they are applied to watched changes. Could reuse the same settings?
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.
The onDidSave
currently also triggers parseAllRecipes
, and usually saving a file will now trigger the change event (because I changed the boolean value to false
). Hence the multiple parses as I mentioned in another conversation. I would prefer to remove the code in onDidSave
.
As for the settings, do we want to have a general setting for all files or one for each file type? Also, in case you don't know, those 3 boolean values in the createFileSystemWatcher
are respectively createEvent
, changeEvent
and deleteEvent
. These may all be configurable.
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.
Bitbake files can only be modified if:
- the user edits them (so he will save them and we already start parse)
- the user runs devtool commands (we already rescan just what's necessary)
So I think we should plainly remove this feature. There's no external bitbake modfications that require any action as I'm aware of.
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.
Some possible modifications are coming from git
. Which was the main reason I created the ticket in the redmine
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.
if we don't care about git
, then we can remove the feature and close this PR
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.
onDidSave
is very usefull to get bitbake diagnostics quickly. Since scanning is so massive, I think we should remove the watchedFiles features. I probed other internal users and they unanimously agreed.
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.
Then we might want to remove the parseAllRecipes
from connection.onDidChangeWatchedFiles
for now. The modification of the rest needs Io's attention
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.
Yes we should remove any kind of Watched Files features 👍
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.
Some possible modifications are coming from
git
. Which was the main reason I created the ticket in the redmine
If it matters, non-opened files could also change with "rename" and "Replace All" (I personally use this one all the time). I would not be surprised if there are other ways.
"EmbeddedLanguageDocsManager" use "workspace.onDidRenameFiles" and "workspace.onDidDeleteFiles" in order to avoid keeping data of non-existing files and have a memory leak. That being said, I assume the user would have to create, delete and rename millions of documents before it becomes noticeable. So I guess we can do without it.
eef5cac
to
aa95122
Compare
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 think we should rather remove any kind of file watching features as discussed in this thread. Parsing when saving is already pretty intrusive and scanning is too long to be automated.
Closed as discussed in the conversations. |
No description provided.