REditorSupport / REditorSupport/vscode-R

Errors do not stop code execution

Open
#1,700 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Describe the bug

Errors do not stop code execution

To Reproduce

  1. Create a R file with the following content:
x <- 2
stop("stop here!")
x * 2
  1. Select all (ctrl+A)
  2. Send to terminal (ctrl+enter)
  3. The line after stop() in executed anyway:
> x <- 2
> stop("stop here!")
Error: stop here!
> x * 2
[1] 4

Can you fix this issue by yourself? (We appreciate the help)

No

Expected behavior

Code execution should stop when an error is thrown.

Environment (please complete the following information):

  • OS: Windows
  • VSCode Version: VSCodium 1.112.01907
  • R Version: 4.4.0
  • vscode-R version: 2.8.8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in VSCode with an R file containing stop() followed by another expression, then select all and send it to the terminal. Trace the extension's handling of selected code and terminal execution. Done means execution stops after the error and the expression after stop() is not executed.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.