Skip to content

Commit a300d71

Browse files
committed
feat(docs): add initial documentation
This commit introduces the initial documentation for the askCode.nvim plugin, generated from the Lua source code using `vimcats`. The documentation is provided in the doc/askcode.txt file, which is the standard format for Vim/Neovim help files.
1 parent c85f60f commit a300d71

1 file changed

Lines changed: 143 additions & 0 deletions

File tree

doc/askcode.txt

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
M.show_in_float() *M.show_in_float*
2+
Creates a floating window to show content.
3+
@param content string The content to display.
4+
@param on_close function A callback to execute when the window is closed.
5+
@param editable boolean|nil Whether the window should be editable (default: false).
6+
@param on_apply function|nil Callback for apply action (Q key) - receives edited content.
7+
@return number, number The window ID and buffer ID.
8+
9+
10+
M.update_float() *M.update_float*
11+
Updates the content of a floating window.
12+
@param win_id number The ID of the window to update.
13+
@param buf_id number The ID of the buffer to update.
14+
@param content string The new content.
15+
@param replacement? boolean if the buffer is for replacement command
16+
@param cursor_line number|nil Optional line number to position cursor (defaults to end).
17+
18+
19+
Config *Config*
20+
21+
Fields: ~
22+
{agent} (string)
23+
{debug} (boolean)
24+
{quit_key} (string)
25+
{output_format} (string)
26+
{window} (table)
27+
28+
29+
M.default *M.default*
30+
31+
Type: ~
32+
(Config) config
33+
34+
35+
M.merge_with_default({changes?}) *M.merge_with_default*
36+
updates config
37+
38+
Parameters: ~
39+
{changes?} (Config)
40+
41+
Returns: ~
42+
(Config)
43+
44+
45+
M.run_command() *M.run_command*
46+
@return number|nil The job_id of the started process, or nil on error.
47+
48+
49+
Agent *Agent*
50+
51+
Fields: ~
52+
{prepare_command} (function)
53+
{parse_response} (function)
54+
55+
56+
M.get_agent({name}) *M.get_agent*
57+
58+
Parameters: ~
59+
{name} (string) The name of the agent to get.
60+
@return Agent? The agent module.
61+
62+
63+
M.setup() *M.setup*
64+
Merges the given configuration with the default settings.
65+
This function will be used to configure the agent in the future.
66+
@param cfg table The configuration table to merge.
67+
68+
69+
M.prepare_command() *M.prepare_command*
70+
Prepares the shell command for sending a prompt to the AmazonQ CLI.
71+
@param prompt string The prompt to be sent.
72+
@return string The fully formed shell command.
73+
74+
75+
M.parse_response() *M.parse_response*
76+
Parses the response from the AmazonQ CLI.
77+
@param response_string string The response string to parse.
78+
@return string? The response, or nil if parsing fails.
79+
80+
81+
M.ask() *M.ask*
82+
Sends a prompt to the AmazonQ CLI and returns the response.
83+
It uses a non-interactive mode by piping the prompt to the CLI.
84+
@param prompt string The prompt to send to the AmazonQ CLI.
85+
@return string? The response from the CLI, or nil if an error occurred.
86+
87+
88+
M.setup() *M.setup*
89+
Merges the given configuration with the default settings.
90+
This function will be used to configure the agent in the future.
91+
@param cfg table The configuration table to merge.
92+
93+
94+
M.prepare_command() *M.prepare_command*
95+
Prepares the shell command for sending a prompt to the Gemini CLI.
96+
@param prompt string The prompt to be sent.
97+
@return string The fully formed shell command.
98+
99+
100+
M.parse_response() *M.parse_response*
101+
Parses the JSON response from the Gemini CLI.
102+
@param json_string string The JSON string to parse.
103+
@return string? The extracted response, or nil if parsing fails.
104+
105+
106+
M.ask() *M.ask*
107+
Sends a prompt to the Gemini CLI and returns the response.
108+
It uses a non-interactive mode by piping the prompt to the CLI.
109+
@param prompt string The prompt to send to the Gemini CLI.
110+
@return string? The response from the CLI, or nil if an error occurred.
111+
112+
113+
M.setup({cfg?}) *M.setup*
114+
setup function
115+
116+
Parameters: ~
117+
{cfg?} (Config)
118+
119+
120+
M.ask() *M.ask*
121+
Starts a new conversation with an AI agent about selected code
122+
Closes any existing conversation and creates a new floating window
123+
@param question string The question to ask the AI agent
124+
@param mode string The mode context (e.g., visual selection info)
125+
126+
127+
M.follow_up() *M.follow_up*
128+
Continues an existing conversation with a follow-up question
129+
Appends to the current conversation history and updates the display
130+
@param question string The follow-up question to ask
131+
132+
133+
M.ask_replace() *M.ask_replace*
134+
Starts a replacement conversation with an AI agent about selected code
135+
Shows response in editable window with apply/cancel options
136+
@param question string The question to ask the AI agent
137+
@param mode string The mode context (e.g., visual selection info)
138+
139+
140+
M.ask_or_follow_up() *M.ask_or_follow_up*
141+
142+
143+
vim:tw=78:ts=8:noet:ft=help:norl:

0 commit comments

Comments
 (0)