-
Notifications
You must be signed in to change notification settings - Fork 167
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
Refactor to optimize for ST3/4 (drops ST2) #344
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit moves all python modules to sub directories and keeps an loader plugin in root, only. It contains only public commands necessary for ST. ST explicitly loads all python modules from root as plugins and looks for EventListeners and Commands within them. This takes time and is therefore not useful for unittests and other library-only modules such as ctags.py. It may even cause harm, as importing ctags into ctagsplugin may cause duplicated modules/globals being present. Note: By using relative imports, this commit breaks compatibility with ST2.
This commit makes use of ST3's `edit_settings` command.
This reverts commit 721c057.
If a module imports elements directly from another one, it shouldn't also import the whole module.
deathaxe
force-pushed
the
refactor/st3plus
branch
from
August 12, 2023 09:04
1a0cf18
to
61d7384
Compare
deathaxe
force-pushed
the
refactor/st3plus
branch
from
January 6, 2024 17:37
3efac06
to
1615b07
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR proposes to refactor package architecture, which meets ST3 and ST4 better.
ST explicitly loads all modules, located in root of packages to look for EventHandler or Command classes. This may cause issues (duplicated globals, etc.) if those modules are also imported by others, especially when reloading a package after upgrade.
Loading unittests etc. is also not of much value, when starting ST.
This PR therefore proposes to move all modules to sub directories and only keep an initializer module in root directory. Various popular packages have moved to this structure.
This PR proposes a single sub directory
plugins
with an initializerplugin.py
, so ST would display "reloading plugin CTags.plugin" in console.Modules are updated to use relative imports, which breaks compatibility with ST2. It would still be possible, but I don't see much value in supporting ST2 anymore.
Another ST2 incompatible change is using
edit_settings
command to open plugin settings side-by-side.