Feature Introduction: When the cursor line is a comment (detected via Treesitter or synID), use a different prompt template that instructs the model to generate the code described by the comment when a special request of auto-complete the function is called.
Feature Description:
-- User writes:
-- parse CSV file and return rows as objects
local function parse_csv(filepath)
end
-- user selects whole block of code
-- Model generates:
local function parse_csv(filepath)
local rows = {}
for line in io.lines(filepath) do
table.insert(rows, vim.split(line, ","))
end
return rows
end
- Detect comment lines via
vim.fn.synID or Treesitter comment nodes
- Use a different system prompt for comment-to-code mode
- Return multi-line blocks with proper indentation
- Fall back to normal completion if cursor is on code
Is your feature possible with the current status of repo? Yes. Requires a new prompt template and comment detection logic. Already have language detection via Treesitter.
Feature Introduction: When the cursor line is a comment (detected via Treesitter or
synID), use a different prompt template that instructs the model to generate the code described by the comment when a special request of auto-complete the function is called.Feature Description:
vim.fn.synIDor Treesitter comment nodesIs your feature possible with the current status of repo? Yes. Requires a new prompt template and comment detection logic. Already have language detection via Treesitter.