Skip to content

Make no-output code behave like running it, and fix message/warning r…#3

Merged
danielrak merged 1 commit into
mainfrom
claude/quirky-wright-b948n8
Jun 24, 2026
Merged

Make no-output code behave like running it, and fix message/warning r…#3
danielrak merged 1 commit into
mainfrom
claude/quirky-wright-b948n8

Conversation

@danielrak

Copy link
Copy Markdown
Owner

…endering

  • Evaluate expressions in the global environment so assignments and other side effects persist, matching the documented behaviour. When code prints nothing to the console (e.g. x <- c(1, 2)), no output block is inserted and any stale block is removed.
  • Normalise captured output, messages, warnings and multi-line errors so every physical line gets its own # comment prefix. Condition messages carry trailing/embedded newlines that previously leaked uncommented text into the .R script.
  • magrittr pipe operators are injected into the global environment only when installed but not attached, and removed again on exit.

Claude-Session: https://claude.ai/code/session_01Pvg4ySztwVFjecx7hNUnA9

…endering

- Evaluate expressions in the global environment so assignments and other
  side effects persist, matching the documented behaviour. When code prints
  nothing to the console (e.g. `x <- c(1, 2)`), no output block is inserted
  and any stale block is removed.
- Normalise captured output, messages, warnings and multi-line errors so
  every physical line gets its own `# ` comment prefix. Condition messages
  carry trailing/embedded newlines that previously leaked uncommented text
  into the `.R` script.
- magrittr pipe operators are injected into the global environment only when
  installed but not attached, and removed again on exit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pvg4ySztwVFjecx7hNUnA9
@danielrak danielrak merged commit 6cda2e6 into main Jun 24, 2026
9 checks passed
danielrak pushed a commit that referenced this pull request Jun 24, 2026
Integrates the quality-audit and significant-improvement work: a fully
refactored, unit-tested addin (helpers extracted for testability, more
robust expression-bounds detection, selection-contains-block handling,
ggplot placeholder rendering) plus a testthat suite, renamed .Rproj,
and updated docs.

Reconciles with the previously merged no-output/message-rendering fix
(PR #3): message/warning/error newline handling and global-environment
evaluation are already covered by the refactor, and the "no console
output behaves exactly like running the code" behaviour (no block
inserted for plain assignments; stale blocks removed) is re-applied on
top of the new structure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pvg4ySztwVFjecx7hNUnA9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants