danr / libkak

Configure and control Kakoune from python | Hosts a Kakoune Language Server Protocol implementation too for now
MIT License
17 stars 2 forks source link

Restructured to allow extensions. Added a few features. #7

Closed topisani closed 6 years ago

topisani commented 6 years ago

Sorry for the huge diff.

The main thing is that i moved out everything in main to free functions. The decorators are then members of a client object, which is what handles the main state.

I did this for writing kakounce-cquery, which needs to handle custom messages and add custom commands, and like this, that part is very easy.

Lastly i also added lsp-rename, and the hidden commands lsp-send-did-save and lsp-buffer-deleted, hooked to the apropriate hooks.

Its been a long time since i wrote any python, so I'm certainly not sure this is the way to do things.

danr commented 6 years ago

Thanks! Really cool that you've delved into this code base.

I changed the client creation code because it essentially made a singleton. (This broke the tests.) Now there is a function makeClient which returns a fresh client (which can be further extended by other libraries).

topisani commented 6 years ago

That makes a lot of sense!

Ill keep throwing you some PRs then. Id like to implement code actions and a few other things. I'm new to kakoune, and really enjoying it!