Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

"Run source with echo" overrides "Run current code chunk"

未关闭
#1,714 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
r, typescript, vscode

调研方向

首先在 vscode-R 扩展中定位“Run source with echo”和“Run current code chunk”的命令及键绑定定义,然后使用包含 # %% 代码块的 R 文件复现 Cmd-Shift-Enter 的行为。确认冲突的绑定或代码块检测是否导致整个文件运行;完成的标准是快捷键只运行当前代码块,同时不破坏其他操作。

由索引模型根据 Issue 内容生成。

描述

bug confirmed

Describe the bug

When the cursor is located inside a code chunk and I press Cmd-Shift-Enter the entire file is run.

For example:

Image

Sends:

r$> source("/Users/carlos/Desktop/scratch.R", encoding = "UTF-8", echo = TRUE)

r$> 5
[1] 5

r$> # %%
r$> a <- 1:3

r$> b <- 4:6

r$> outer(a, b)
     [,1] [,2] [,3]
[1,]    4    5    6
[2,]    8   10   12
[3,]   12   15   18

r$> # %%
r$> 2
[1] 2

To Reproduce

  • Create a code chunk with # %% ...
  • Run it using "Run current code chunk" from the command palette -> fine
  • Run it using code lens actions -> fine
  • Run it using C-S-Enter -> the entire file is run

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

Yes, I need to remove the conflicting binding. But I guess that the intention here is to use the same shortcut for both and the problem is that chunk detection is failing.

(If applicable) Please attach setting.json

  "[r]": {"editor.tabSize": 2},
  "r.rterm.mac": "/Users/carlos/.venv/bin/radian",
  // https://github.com/REditorSupport/vscode-R/issues/809#issuecomment-935947010
  "r.bracketedPaste": true,
  "r.plot.useHttpgd": true,

Environment (please complete the following information):

  • OS: macOS Tahoe
  • VSCode Version: 1.125.1
  • R Version: 4.5.3
  • vscode-R version: 2.8.8
主要语言
TypeScript
星标
1.2k
派生
139
平均合并
20 小时 32 分钟
30 天内合并 PR
25

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

REditorSupport/vscode-R 的其他 Issue

查看 REditorSupport/vscode-R 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。