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

Refactor to optimize for ST3/4 (drops ST2) #344

Merged
merged 15 commits into from
Jan 6, 2024
Merged

Conversation

deathaxe
Copy link
Member

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 initializer plugin.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.

Note
To keep current release available for ST2 dedicated st2-0.4.x tags could be added with package_control_channel being updated.

Package Control 4 will however drop support for ST2 anyway.

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.
If a module imports elements directly from another one, it shouldn't also import
the whole module.
@deathaxe deathaxe merged commit 0dd98fd into development Jan 6, 2024
2 checks passed
@deathaxe deathaxe deleted the refactor/st3plus branch January 6, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant