-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: extend lz.n with custom handlers #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🙏
Some notes (on top of my other comments):
- Please amend the commit according to the conventional commit specification.
Otherwise, CI won't pick it up for the changelog and semver version. - We should also expose the
lz.n.loader.load()
function as part of the public API
(via thelz.n
module). Handlers need to be able to call it, because it takes care of properly deregistering the plugins. - This needs to be tested. Perhaps a very simple test handler that can be invoked from a callback.
See the other tests in thespec/
directory for inspiration.
I usebusted
for testing. Since you use Nix, you can just runbusted
orluarocks test
from within the devShell.
You can also run everything (linting, type checking, ...) withnix flake check -Lv
.
Checks are failing. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
It's one of the most valuable skills to practise 😄 Please don't hesitate to ask for help if you get stuck. I suggest looking at |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nitpicks 😃
This comment was marked as abuse.
This comment was marked as abuse.
added require('lz.n').register_handler(lz.n.HandlerSpec) added lz.n.Plugin.extras for extra spec items from custom handlers. feat: extend lz.n with custom handlers feat: extend lz.n with custom handlers added tests Update spec/register_handler_spec.lua Co-authored-by: Marc Jakobi <[email protected]> Update spec/register_handler_spec.lua Co-authored-by: Marc Jakobi <[email protected]> feat: extend lz.n with custom handlers Update README.md Co-authored-by: Marc Jakobi <[email protected]> Update lua/lz/n/handler/init.lua Co-authored-by: Marc Jakobi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉 🚀
added require('lz.n').register_handler(lz.n.HandlerSpec)
added lz.n.Plugin.extras for extra spec items from custom handlers.
Added type declarations to avoid throwing warnings from adding extra items to the spec
This was necessary because require('lz.n.handler').init must call the custom handler, which cant reasonably be done from outside of the plugin.