% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/addins.R
\name{addin_explain_code}
\alias{addin_explain_code}
\title{Explain selected R code as inline comments}
\usage{
addin_explain_code()
}
\value{
Invisible \code{NULL} (called for side-effects).
}
\description{
Select a block of R code in the editor, then trigger this addin
(recommended shortcut: \code{Ctrl+Shift+E} / \code{Cmd+Shift+E}).  An explanation is
inserted as \verb{#} comment lines immediately \strong{above} the selected code block.
}
\details{
The LLM receives the selected code and is instructed to produce a concise,
human-readable explanation — focusing on \emph{what} the code does and \emph{why},
not on basic R syntax.  Every output line is prefixed with \verb{# } so the
explanation is valid R that can be left in the source file.
}
\seealso{
\code{\link[=addin_generate_from_comment]{addin_generate_from_comment()}}, \code{\link[=llmcoder_setup]{llmcoder_setup()}}
}
