sublime_lib
sublime_lib copied to clipboard
Utility library for frequently used functionality in Sublime Text and convenience functions or classes
Iterating over `view.settings()` yields a list of `(key, value)` pairs. That's a non-standard iteration procedure, but something we can certainly work with to provide a proper dict/MutableMapping interface. Related: https://github.com/sublimehq/sublime_text/issues/3459
The issue mentioned in https://github.com/SublimeText/sublime_lib/issues/118#issuecomment-499098498 for improving type hint rendering through sphinx has been closed (https://github.com/sphinx-doc/sphinx/issues/5868). From my understanding, this should allow us to add type hints to the documentation...
Sometimes, a plugin will want to load data from an open-ended number of resources. A motivating example is our own use of `sublime-syntax` and `tmLanguage` files in `sublime_lib.syntax`. Another example...
PackageDev needs to know what commands exist in order to perform autocompletion, and it provides an [implementation](https://github.com/SublimeText/PackageDev/blob/master/plugins_/command_completions/commandinfo.py) of the necessary logic (as well as a list of known built-in commands)....
This is something that ST just cannot do at the moment and thus leaves plugins mostly struggling to clean up their resources or whatever. Because it's something that can be...
The `View.is_primary()` only tells if the view is the "primary". If the view is the "primary", it does not tell whether it has multiple views into the underlying buffer. Some...
Inspired by [this forum thread](https://forum.sublimetext.com/t/what-is-the-best-way-for-a-command-to-call-another-command-in-a-different-package/44757/11). Some packages want to allow package settings to be overridden per view, per window, and/or per project. We recommend using a ChainMap of SettingsDicts for...
In order to implement `ResourcePath.from_file_path()` and `Resource_path.file_path()`, we internally keep a list of `ResourceRoot` objects. Exposing these roots could allow users to answer various tricky questions about resources: - Is...
Several packages, including PackageDev and AutomaticPackageReloader, try to determine the resource path of a file path supplied via `view.file_name()` or some other “external” source. `ResourcePath.from_file_path` can't do this reliably because...