Repository navigation
Follow and watch settings.json single-level symlinks - #9382
Conversation
|
I'd leave this for Benjamin Pasero (@bpasero). He won't be back for a couple of weeks though. |
…_symlink_settings
|
Daniel Imms (@Tyriar) as far as I can tell from your change you change the watching behavior to only watch on settings.json and not the parent folder. Did you try that other settings like keybindings are still being watched for changes? |
…_symlink_settings
|
Benjamin Pasero (@bpasero) do you know where the keybindings are being watched, it's mentioned in this file but a watcher doesn't seem to exist? When I did this originally I assumed keybindings needed a full restart to get working, I don't think they ever worked with symlinks. |
|
Daniel Imms (@Tyriar) we watch the parent folder of the settings file so every change within causes the event to trigger and keybindings is next to storage.json as far as I know. You do NOT need a restart for changing keybindings, wtf :) |
|
Benjamin Pasero (@bpasero) yep, I realized that a few weeks ago lol. Is |
|
I believe so, but since this file is now being used in other processes I am not sure what else ends up in there. I think it would be safer to install the watcher on the folder, read the files inside and for each file that is a link to another file, install the watcher on that resolved file. |
|
I like it 👍 |
|
Benjamin Pasero (@bpasero) ready for review, I tested using symlink and regular settings/keybindings files (on Linux). |
| let self = this; | ||
| function attachSettingsChangeWatcher(watchPath: string): void { | ||
| self.watcher = fs.watch(watchPath); | ||
| self.watcher.on('change', (eventType: string, fileName: string) => self.onSettingsFileChange(eventType, fileName)); |
There was a problem hiding this comment.
I think onSettingsFileChange ignores eventType and fileName so maybe just remove it from there and invocations.
|
Daniel Imms (@Tyriar) LGTM but added 2 comments. |
Fixes #8547
Not sure how it ever worked looking at the commit history, this works though. Couldn't find an option to give to the watcher.