kdcro101 / vscode-favorites

Add files and directories to workspace favorites. You can create groups (and subgroups) of favorite items with files and folders. Time saver for complex projects.
MIT License
49 stars 13 forks source link

Add option to save settings outside workspace #23

Closed ysjn closed 5 years ago

ysjn commented 5 years ago

Hi, thanks for making this great extension! :pray:

It would be great if this plugin had an option to not use workspace setting (.vscode/settings.json), or had an option to save setting outside workspace. I want to avoid these settings file showing up as changed file on source control(git).

Could extension settings (and possibly .favorites.json) be stored in extension specific storage? Maybe as a vscode.ExtensionContext or save settings in ~/.vscode/extensions/. (Sorry if I’m pointing out something irrelevant, I’m not familiar with vscode extension authoring).

cheers.

kdcro101 commented 5 years ago

@ysjn ,

Thank you for your feedback.

If you want to avoid to favorites.json showing up in changed files, you can use following workaround:

You can use other file name than .favorites.json. Purpose of favorites.storageFilePath is to overrride storage path relative to workspace

kdcro101 commented 5 years ago

@ysjn ,

Closing this issue.

If you have any problems, open issue.

ysjn commented 5 years ago

@kdcro101 Thanks for quick reply.

I understand that I could use .gitignore to stop tracking changes. I'll try that workaround for .favorite.json.

However, if .vscode/settings.json are used to share workspace settings for all contributors, it can't simply be ignored. But, changes I make to .vscode/settings.json(like changing sort direction in favorites) will show up in changed files and will be reflected to all contributors working in that repo. This could cause some problems when working with repository with many contributors.

I thought it might be easier to use this extension if those settings are not dependent on workspace settings.

I really like this plugin since vscode won't let me save multiple editor sets on single workspace. I would love to use this plugin in many repositories.

kdcro101 commented 5 years ago

@ysjn ,

I understand you problem better, now. Problem is shared settings. Do you need to use it? That makes impossible for developer to customize anything.

ysjn commented 5 years ago

I use shared settings sometime. But since not many people are reacting to this issue, maybe it's not major problem.

For the sort options, is it possible to change user settings(~/Library/Application Support/Code/User/settings.json) directly?

Like this extension is doing.

https://github.com/Tom-Bonnike/vscode-formatting-toggle https://twitter.com/tombonnike/status/961328300034490368

kdcro101 commented 5 years ago

@ysjn ,

Yes you can. Workspace settings are just an override for user settings. If you define setting in user settings it will be the same for all projects/workspaces.

ysjn commented 5 years ago

@kdcro101 Apologies for my late reply.

I confirmed that writing my options to user settingsUser/settings.json will prevent from generating .vscode/settings.json. In combination with "favorites.storageFilePath" setting, my problem is solved.

Thanks for the support!