Disable all breakpoints in RStudio

2020-08-13 08:35发布

问题:

Is there a a way to disable all breakpoints in RStudio? I have looked at the RStudio documentation as well as done google searches but couldn't find a way.

回答1:

I was curious too, especially wanted to have an overview of breakpoints.

I ran grep in my project folder and this is what I found:

At first, with RStudio opened, the breakpoints don't show up, they're probably somewhere in memory:

$ grep -inIEr "breakpoint" .
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:2:    "debugBreakpointsState" : {
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:3:        "breakpoints" : [
grep: ./.Rproj.user/1C48145B/sources/s-8EAA4F36/lock_file: Device or resource busy

Then when we close RStudio, it seems they're written to a file called debug-breakpoints.pper

$ grep -inIEr "breakpoint" .
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:2:    "debugBreakpointsState" : {
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:3:        "breakpoints" : [
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:10:                "is_package_breakpoint" : false,
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:25:                "is_package_breakpoint" : false,
./.Rproj.user/1C48145B/pcs/find-in-files.pper:7:        "query" : "breakpoint",

The file can be found at ./.Rproj.user/1C4***5B/pcs/debug-breakpoints.pper and looks like this:

{
    "debugBreakpointsState" : {
        "breakpoints" : [
            {
                "editor_line_number" : 4,
                "editor_state" : 1,
                "function_name" : "toplevel",
                "function_steps" : "",
                "id" : 2,
                "is_package_breakpoint" : false,
                "is_pending_debug_completion" : false,
                "line_number" : 4,
                "needs_updated_steps" : false,
                "package_name" : "",
                "path" : "C:/Users/path/to/project/analysis_tab.R",
                "state" : 1,
                "type" : 1
            },
            {
                "editor_line_number" : 193,
                "editor_state" : 1,
                "function_name" : "toplevel",
                "function_steps" : "",
                "id" : 3,
                "is_package_breakpoint" : false,
                "is_pending_debug_completion" : false,
                "line_number" : 193,
                "needs_updated_steps" : false,
                "package_name" : "",
                "path" : "C:/Users/path/to/project/analysis_tab.R",
                "state" : 1,
                "type" : 1
            }
        ]
    }
}

Manually editing this file when RStudio is closed lets us manage our breakpoints. (With RStudio opened, changes made to this file would eventually be overwritten).



回答2:

It's right there under the Debug menu:

Default keyboard shortcut (on my system): Ctrl+Shift+F9



标签: rstudio