Skip to content
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

Change location of 'Settings - User' file #5

Closed
joelpt opened this issue Jun 9, 2012 · 4 comments
Closed

Change location of 'Settings - User' file #5

joelpt opened this issue Jun 9, 2012 · 4 comments

Comments

@joelpt
Copy link

joelpt commented Jun 9, 2012

Currently SublimeText-NaturalDocs uses a location of Packages/User/Base File.sublime-settings for its user setting data.

I suggest changing this location to Packages/User/NaturalDocs.sublime-settings. Use of Base File.sublime-settings is considered deprecated in ST2 for plugin user-settings storage, primarily because it would have to be shared among all installed plugins. NaturalDocs.sublime-settings gives us an isolated place for NaturalDocs-only user settings.

This approach is well-supported by ST2; get the plugin's settings using

settings = sublime.load_settings('NaturalDocs.sublime-settings')

and it will automatically acquire settings from Packages/NaturalDocs/NaturalDocs.sublime-settings first, then override those with anything found in Packages/User/NaturalDocs.sublime-settings.

@njlg
Copy link
Member

njlg commented Jun 11, 2012

Where does it say that User/Base File.sublime-settings is deprecated? All the packages I have installed use the same structure that the NaturalDocs plugin uses; which does not imply it is correct, but it is consistent at least.

This is a personal preference, but I like being able to open one file User/Base File.sublime-settings (which is also User/Preferences.sublime-settings), and see all of the settings I have changed across all packages. I do not have to open endless amounts of files per package to see how things are configured.

@joelpt
Copy link
Author

joelpt commented Jun 11, 2012

Well, I suppose you are right, it's a personal preference thing. My preference is to use separate files so it is clear which settings belong to which plugin; for example one of my plugins has a setting named tag_type. I wouldn't be likely to guess which plugin owned that setting.

One technical reason for separate files is to eliminate the potential for namespace collisions of setting names between plugins. The odds of this occurring are probably small, but with setting names like tag_type floating around, it could happen.

I did a quick survey of all the plugins I have installed via Package Manager which create an entry in Preferences->Package Settings; of the 12 I have installed, 10 use the PluginName.sublime-settings pattern for the user settings file, including Package Manager itself. (Not counting NaturalDocs)

I remember reading somewhere that Base File.sublime-settings is being deprecated and plugin authors should move towards separate files, but I can't find the specific tidbit now. The closest thing I could find is this excerpt from http://www.sublimetext.com/dev:

Build 2175
Release Date: 3 February 2012

  • Packages defining new settings in old style Base File.sublime-settings files will have them picked up again

@njlg
Copy link
Member

njlg commented Jun 11, 2012

Okay, well, it looks like Plugin authors are switching to this new method. This like vaguely alludes to such: http://www.sublimetext.com/docs/2/settings.html

I'll make the change pretty soon.

@njlg
Copy link
Member

njlg commented Jul 3, 2012

I am pretty sure that I got the change implemented now.

@njlg njlg closed this as completed Jul 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants