Skip to content

Commit 35d3aa4

Browse files
committed
fix(types): correct type declarations for Git and Generator classes
- move generate_commit_message function from Git class to proper Generator class - add missing get_commit_history function declaration to Git class - fix indentation and formatting issues in type annotations
1 parent c1a90b6 commit 35d3aa4

File tree

1 file changed

+4
-3
lines changed
  • lua/codecompanion/_extensions/gitcommit

1 file changed

+4
-3
lines changed

lua/codecompanion/_extensions/gitcommit/types.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
---@field use_commit_history? boolean Enable using commit history as context (default: true)
2-
---@field commit_history_count? number Number of recent commits to include as context (default: 10)
32

4-
---@field exports CodeCompanion.GitCommit.Exports
53

64
---@class CodeCompanion.GitCommit.ExtensionOpts.Buffer
75
---@field enabled boolean Enable buffer-specific keymap for git commit
@@ -53,7 +51,10 @@
5351
---@field get_staged_diff fun(): string|nil -- Get git diff for staged changes
5452
---@field commit_changes fun(message: string): boolean -- Commit changes with the provided message
5553

56-
---@field generate_commit_message fun(diff: string,lang: string?, commit_history: string[]?, callback: fun(result: string|nil, error: string|nil)): nil -- Generate commit message using LLM
54+
---@field get_commit_history fun(count?: number): string[]|nil -- Get recent commit messages for context
55+
56+
---@class CodeCompanion.GitCommit.Generator
57+
---@field generate_commit_message fun(diff: string, lang: string?, commit_history: string[]?, callback: fun(result: string|nil, error: string|nil)): nil -- Generate commit message using LLM
5758

5859
---@class CodeCompanion.GitCommit.UI
5960
---@field show_commit_message fun(message: string, on_commit: fun(message: string): boolean): nil -- Show commit message in a floating window with interactive options

0 commit comments

Comments
 (0)