spyder-ide / spyder-vim

A plugin for Spyder to enable Vim keybindings
https://www.spyder-ide.org
MIT License
126 stars 26 forks source link

PR: Updates to provide Spyder 5 compatibility #77

Closed ok97465 closed 2 years ago

ok97465 commented 2 years ago

Hello

It's much later than the promised time. I was really too busy. ^^; For the file name and structure, spyder-plugin-cookiecutter is applied as much as possible.

Thank you.

Fixes #31 Fixes #41 Fixes #75 Fixes #76

dalthviz commented 2 years ago

Hi @ok97465 ! Thank you so much for all the effort in doing this! A quick check of the failing tests suggests that the requirements/test.txt file should be instead requirements/tests.txt (with a final s). Will try to give it a review next week and hopefully soon try to do a release :)

ok97465 commented 2 years ago

Finally, I am going on a summer vacation, so I can't modify this PR until the end of next week. I will check next week if there are any problems. ^^

dalthviz commented 2 years ago

Enjoy your vacations @ok97465! Again, thank you so much for your work here! :)

ok97465 commented 2 years ago

@dalthviz Can you explain the sentence below in detail?

if there is a better approach to handle the VimWidget from the main container and the dependency with the Editor

dalthviz commented 2 years ago

So basically the idea for plugins on Spyder 5 is to use the main container/main widget as the class that handles any needed widgets while the plugin acts just as an interface for other plugins to access functionality, so in theory (or at least tryiong to follow the spirit of the Spyder 5 plugins API) the relation between classes should be something like: SpyderVimPlugin > SpyderVimContainer > VimWidget or probably the SpyderVimContainer should become/add inside it the VimWidget logic).

Regarding the Editor, I think we should check if over the Editor plugin side some level of API should be added/implemented to handle a plugin connecting to its layout and actions without the need to have a reference to the Editor itself or need to access the Editor through the reference to the mainwindow (self.main) that the plugins have (at the end try to decouple the Editor and SpyderVim plugins as much as we can).

Off course these are just initial ideas that we need to further discuss (probably you have a better understanding of how things are working right not for this plugin) but I think that an implementation following other plugins structure more closely and decoupling things between plugins will help in the future and make things easier to maintain here :)