feat: add submit hook#203
Conversation
There was a problem hiding this comment.
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