-
-
Notifications
You must be signed in to change notification settings - Fork 817
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
How to handle dependencies that want to expose settings #1659
Comments
A possible solution for lsp_utils would be a separate helper package, such as LSP-utils, which provides the settings. It would need to be anounounced and installed separately though. Maybe at some point in future, it can be specified as being required by all the LSP-... helpers, which also require lsp_utils. Same would theoretically work for mdpopups, but it only ships a Preferences.sublime-settings and a Otherwise Package Control would need to somehow identify "ST package style" parts of a dependency and auto-maintaina a ST package for them. That's probably not feasable for various reasons:
It's up to plugin/library authors to find ways to achieve that. |
The following snippet illustrates an example how to search for certain files in libraries, if required. Note it's rather naive and returns duplicates in case a library is installed in multiple environments. import sublime
from pathlib import Path
def get_sublime_package_json():
lib_root = Path(sublime.packages_path()).parent / "Lib"
if int(sublime.version()) > 4000:
lib_dirs = ["python33", "python38"]
else:
lib_dirs = ["python3.3"]
for py in lib_dirs:
for fname in (lib_root / py).glob("*/sublime-package.json"):
yield fname
print(tuple(get_sublime_package_json())) |
mdpopups doesn't expose any commands in the command palette, and it reads its settings from So a simple solution for dependencies/libraries that want to use settings seems to be to just read from Python 3.3 sublime.load_settings('Preferences.sublime-settings').get('setting_name', 'default_value') Python 3.8 sublime.load_settings('Preferences.sublime-settings').setdefault('setting_name', 'default_value') ( It would probably be a good idea to describe the available setting in the Readme page, and mdpopups already has descriptions for the settings in its documentation. Regarding the |
Mdpopups can just use |
There wasn't any suggestion for mdpopus to switch from |
I wasn't saying that was suggested. I was saying we (mdpopups) could ensure we use |
I am not fully satisfied with having to use global preferences. Specifically with the fact that in that case the reference for the settings has be outsourced to some less convenient place like a readme or github. It requires extra actions from the user to see those. LSP-json can help somewhat (once it supports reading schema from libraries) but it's not really great for getting an overview of the available settings. Especially within global preferences where a ton of other settings are also available... |
As far as I'm aware, LSP is going to integrate/rewrite |
Yeah, this issue doesn't affect |
With regards to a statement of what dependencies are at #1663 (comment), I am closing this issue. The only possible extension would be adding a feature to let packages depend on each other. |
I'd like to discuss the possibility of supporting libraries that want to expose settings (and potentially just any other components that a normal package can expose).
As we know, both
lsp_utils
andmdpopups
(anything else?) want to expose corresponding dependency settings apart from the dependency itself. With PC4 this now longer works. I can't think of any good alternatives for how to handle those currently.lsp_utils
could potentially be integrated intoLSP
itself but that wouldn't really work formdpopups
.Should there maybe exist a way for a dependency to specify a list of files that should be copied to Packages directory?
CC: @rwols @deathaxe @facelessuser @predragnikolic @jwortmann @jfcherng
The text was updated successfully, but these errors were encountered: