Skip to content

Follow and watch settings.json single-level symlinks - #9382

Merged
Daniel Imms (Tyriar) merged 5 commits into
masterfrom
tyriar/8547_support_symlink_settings
Aug 9, 2016
Merged

Daniel Imms (Tyriar) merged 5 commits into
masterfrom
tyriar/8547_support_symlink_settings

Conversation

@Tyriar

Copy link
Copy Markdown
Contributor

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.

@joaomoreno

Copy link
Copy Markdown
Contributor

I'd leave this for Benjamin Pasero (@bpasero). He won't be back for a couple of weeks though.

@joaomoreno João Moreno (joaomoreno) removed their assignment Jul 18, 2016
@bpasero

Copy link
Copy Markdown
Contributor

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?

@bpasero Benjamin Pasero (bpasero) removed this from the August 2016 milestone Aug 9, 2016
@Tyriar

Copy link
Copy Markdown
Contributor Author

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.

@bpasero

Copy link
Copy Markdown
Contributor

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 :)

@Tyriar

Daniel Imms (Tyriar) commented Aug 9, 2016 •

Copy link
Copy Markdown
Contributor Author

Benjamin Pasero (@bpasero) yep, I realized that a few weeks ago lol. Is keybindings.json the only other file we want this change event firing for? storage.json too?

@bpasero

Copy link
Copy Markdown
Contributor

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.

@Tyriar

Copy link
Copy Markdown
Contributor Author

I like it 👍

@Tyriar

Daniel Imms (Tyriar) commented Aug 9, 2016 •

Copy link
Copy Markdown
Contributor Author

Benjamin Pasero (@bpasero) ready for review, I tested using symlink and regular settings/keybindings files (on Linux).

Comment thread src/vs/base/node/userSettings.ts Outdated
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));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think onSettingsFileChange ignores eventType and fileName so maybe just remove it from there and invocations.

@bpasero

Copy link
Copy Markdown
Contributor

Daniel Imms (@Tyriar) LGTM but added 2 comments.

@Tyriar
Daniel Imms (Tyriar) merged commit 4d5810c into master Aug 9, 2016
@Tyriar
Daniel Imms (Tyriar) deleted the tyriar/8547_support_symlink_settings branch August 9, 2016 20:38
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate why configuration via symlinks no longer update

4 participants