… each package should instruct that dependency what settings are valid …
This would definitely be a clean and good solution. I also thought about that, because GitGutter allows all package settings to be placed into a Preferences.sublime-settings by adding the prefix git_gutter_
to the keys.
The questions to answer are:
- What’s the easiest way for packages to mark certain keys as valid?
- How to support packages which may be no longer maintained or the author is not willing to put effort into supporting settings completion/linting? (e.g.: theme or color scheme packages)
- How can such a solution being built with least package dependencies?
In the end requesting a sublime-settings file with proper comments answers all these questions best at the moment.
For future use I am absolutely with you to somehow offer some kind of API to give packages the ability to provide valid settings just like the on_query_completions
event does at the moment.
About the syntax definition, well, for most people, the standard JSON one is enough …
The functionality of my EasySettings fork does not require a separate syntax. It was added because of the idea to add everything to PackageDev. Nevertheless I find the idea of having an extended syntax for sublime-settings files quite interesting as it allows separate icons to be added to sublime-files (see A Icon File) and display the file type in the statusbar like Sublime Text Settings (JSON)
. Furthermore packages can use the separate scope to do certain actions or handle events for it only.
Default JSON misses the keys to be highlighted. Most color schemes just use the meta.structure.dictionary.key
scope for highlighting which I find bad practice.
The Sublime Text Settings.sublime-syntax file included in my fork makes use of Default JSON.sublime-syntax and I do not intend to write a standalone syntax. It just alters default syntax by allowing an object at toplevel only and adding a keyword.other.name.key.sublime.settings
scope to top-level keys.
I think that PackageDev’s will be the best one (when it’s complete/rewritten), and therefore shouldn’t need to be part of a separate package.
This leads to a very fundamental question: What is the primary intend of settings and keybindings completion? Is it meant to make package developement easier or do we want to help end users to customize settings?
From my point of view some features of PackageDev do address normal user use cases, which would be better placed into core or separate package. Editing settings/keybindings is one of them. As @addons_zz says: keep it stupid and simple.