vscode-R: Extend selection does not work when code contains brackets in quotes

Sending code without selection will call extendSelection first to determine a minimal runnable chunk from the active line. However, it does not seem to work if the code chunk contains string literals where any brackets are present.

Following is a minimal example:

x <- list(list(a = 1, b = 2),
  list(a = 2, b = 3),
  list(a = 3, b = 4))
res <- local({
  lapply(x, "[[", "a")
})

Put cursor at res, and send code to active terminal, then it does not find the code chunk

res <- local({
  lapply(x, "[[", "a")
})

rather, it only sends the first line:

res <- local({

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@andycraig It would be nice if both single-line and multi-line strings could be handled.