% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/addins.R
\name{addin_generate_from_comment}
\alias{addin_generate_from_comment}
\title{Generate R code from a comment (silent insert)}
\usage{
addin_generate_from_comment()
}
\value{
Invisible \code{NULL} (called for side-effects).
}
\description{
Places the cursor on a line beginning with \verb{#}, then triggers this addin
(default shortcut: \code{Ctrl+Shift+G} on Windows/Linux, \code{Cmd+Shift+G} on macOS).
The LLM reads the comment text and the surrounding code context, then inserts
the generated R code on the line immediately below the comment.
}
\details{
The addin extracts the text of the comment at the cursor position and up to
\code{getOption("llmcoder.context_lines", 40L)} lines of preceding code as
context.  The provider, model, and API key are taken from options set by
\code{\link[=llmcoder_setup]{llmcoder_setup()}} or the \strong{LLMcoder Settings} addin.

No dialog is shown; code is inserted immediately.  Use
\code{\link[=addin_generate_with_preview]{addin_generate_with_preview()}} if you prefer to review the output first.
}
\seealso{
\code{\link[=addin_generate_with_preview]{addin_generate_with_preview()}}, \code{\link[=llmcoder_setup]{llmcoder_setup()}}
}
