Skip to content

Add ability to reload a file icon theme without restarting the editor#60136

Closed
JimiC wants to merge 5 commits intomicrosoft:masterfrom
JimiC:reloadFileIconTheme
Closed

Add ability to reload a file icon theme without restarting the editor#60136
JimiC wants to merge 5 commits intomicrosoft:masterfrom
JimiC:reloadFileIconTheme

Conversation

@JimiC
Copy link
Contributor

@JimiC JimiC commented Oct 8, 2018

Resolves #45963

This PRs adds the ability to reload the file icon theme without the need to restart the editor.

@aeschli I also took the liberty to do some refactoring in workbenchThemeService and fileIconThemeData files.

The changes are:

  • Switched let to const where applicable.
  • I noticed that those files have functions that where used by the class but where outside them, so I moved those functions inside the class.
  • Also, there are some helper inner functions written in an es5 syntax, which I switched to es6 syntax.

If those refactorings are unwanted, I have no problem to revert them.

I also value your guidance and input, in case I implemented this feature against the coding guidelines or the code can be improved.

Copy link

@ctrlaltvikas ctrlaltvikas left a comment

Choose a reason for hiding this comment

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

LGTM

@aeschli
Copy link
Contributor

aeschli commented Oct 8, 2018

@JimiC Can you make the changes minimal? No let to const or convert functions to methods unless really necessary.

@JimiC
Copy link
Contributor Author

JimiC commented Oct 8, 2018

@aeschli Sure. I so much guessed that all these changes will not make the code review an easy task.

@JimiC
Copy link
Contributor Author

JimiC commented Oct 8, 2018

@aeschli Submitted code with minimal changes.

@dotnetcanuck
Copy link

What's the latest status on this PR? I use vscode-icons, but the constant reloading is really starting to get annoying, heh.

@JimiC
Copy link
Contributor Author

JimiC commented Dec 11, 2018

@aeschli
I have resolved the conflicts with master. Do we have any news on the fate of this PR?

@aeschli
Copy link
Contributor

aeschli commented Jan 4, 2019

Sorry, I was out for 2 month. The code changes to the theme service look good to me, but the controversial part are the APIs. They don't fit with the existing vscode APIs and contribution points. We have no other API that signals that a static contribution point (or parts of it) needs to be reloaded.

I think the proper ways would be:

  • no new API but we add a file watch to the currently active file icon (and color) theme definition file. On file change the theme is automatically reloaded. That would also enable theme authors to try out changes directly in the theme file.

  • new API that allows to programmatically provide a icon theme and change event?

Would the first suggestion work for you?

@JimiC
Copy link
Contributor Author

JimiC commented Jan 4, 2019

@aeschli A watcher over the icon definition file would do the job as well.

Is there somewhere in the code-base a similar case so I can have a look at it and maybe provide a revised PR?

@aeschli
Copy link
Contributor

aeschli commented Jan 4, 2019

The fileService has methods watchFileChange/unwatchFileChanges to enable/disable the watcher, onFileChanges is the event to listen to.

@JimiC
Copy link
Contributor Author

JimiC commented Jan 6, 2019

Closing in favor of #66115

@JimiC JimiC closed this Jan 6, 2019
@JimiC JimiC deleted the reloadFileIconTheme branch January 8, 2019 18:56
@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.

[icon themes] Expose API to provide a dynamic icon theme.

4 participants