-
Notifications
You must be signed in to change notification settings - Fork 91
feat: add submit hook #203
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
base: master
Are you sure you want to change the base?
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.
Pull Request Overview
This PR adds a new on_submit hook to the LeetCode plugin that triggers when a solution is submitted. The hook provides access to the question, buffer contents, and submission status message.
- Adds
on_submithook definition to the configuration template - Implements hook execution in the runner when a submission is detected
- Includes utility module import for hook execution
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lua/leetcode/config/template.lua | Adds the on_submit hook type definition with proper typing |
| lua/leetcode/runner/init.lua | Imports utils module and executes the on_submit hook when submission is detected |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
The hook should include information about whether the submission was successful. You can do it by adding a |
|
added ._.success into the hook parameter, it's now up to the hook implementation to how to differentiate successful submission and failure submission in case one wants to thoroughly review his submission quality |
below is a sample on_submit hook with working demo
2025-09-17-003214_hyprcap.mp4