Closed timotheecour closed 5 years ago
for reference:
edit $nim_D/NimLime/core/commands/nimcheck.py
(eg: change msg here: sublime.status_message('Nim Check Finished.')
then in sublime console:
import sublime_plugin
sublime_plugin.reload_plugin('NimLime.core.commands.nimcheck')
then the changes will take effect.
calling the cmd package_reloader_reload from AutomaticPackageReloader (modulo this fix https://github.com/randy3k/AutomaticPackageReloader/pull/17 in case there are symlinks):
[Package Reloader] begin ======================================================
reloading plugin NimLime.NimLime
[Package Reloader] reloading |-- NimLime
[Package Reloader] reloading |-- NimLime.NimLime
[Package Reloader] reloading | |-- NimLime.core
[Package Reloader] reloading | |-- NimLime.core.commands
[Package Reloader] reloading | | |-- NimLime.core.utils
[Package Reloader] reloading | | |-- NimLime.core.utils.misc
[Package Reloader] reloading | | |-- NimLime.core.settings
[Package Reloader] reloading | | |-- NimLime.core.configuration
[Package Reloader] reloading | | |-- NimLime.core.utils.error_handler
[Package Reloader] reloading | | |-- NimLime.core.utils.mixins
[Package Reloader] reloading | | |-- NimLime.core.utils.project
[Package Reloader] installing dummy package
reloading plugin _dummy_package
[Package Reloader] removing dummy package
unloading plugin _dummy_package
[Package Reloader] end --------------------------------------------------------
as you see above, I'm not seeing NimLime.core.commands.nimcheck
in the above log /cc @randy3k
"reload_on_save": false,
in AutomaticPackageReloader setting, it seems to disable the "Nim Check" action that runs on save class NimCheckOnSaveListener(NimCheckCurrentView, EventListener):
so the safest seems to be running sublime_plugin.reload_plugin('NimLime.core.commands.nimcheck')
Even though the modules themselves don't appear in the above log, they do appear to be reloaded:
It’s because NimLime.core.commands has a custom loader https://github.com/Varriount/NimLime/blob/master/nimlime_core/commands/__init__.py
I even tried AutomaticPackageReloader but didn't work see https://github.com/randy3k/AutomaticPackageReloader/issues/15
also tried various stuff here https://forum.sublimetext.com/t/how-can-i-reload-a-plugin-in-sublime-console/34325