Skip to content

debugonce() "loses focus" on file after printing out local variable #10664

Closed

Description

@DavisVaughan

System details

RStudio Edition : Desktop
RStudio Version : Daily 2022.02.0 Build 427
OS Version      : Mac
R Version       : 4.1.1

Steps to reproduce the problem

Run the following and then step through the debugger like I do in the video

library(slider)

debugonce(slider:::slide_impl)

slide_dbl(1:5, identity)

Describe the problem in detail

After using debugonce(), you are generally taken to a file where you can step through the code. It seems that if you:

  • Begin stepping
  • Print out a local variable
  • Continue stepping

then the IDE will lose focus of that file.

The video below shows this by first stepping through the function without printing anything out (which works), and then shows the buggy situation where focus on the file is lost.

Untitled.mov

Activity

  1. DavisVaughan commented on Apr 27, 2022

    @DavisVaughan
    Author

    It is worth noting that this doesn't occur for packages that you have used devtools::load_all() on.

    i.e. if I do devtools::load_all() to load slider, then do debugonce(slide_int), then it works fine.

    But as seen above if I do library(slider) then debugonce(slide_int), then it breaks

  2. kevinushey commented on Apr 27, 2022

    @kevinushey
    Collaborator

    This bug effectively makes the debugger unusable (it's a bad regression and affects debugging for any function) so it needs to be fixed in SW.

  3. added
    backport
    on May 2, 2022
  4. mikebessuille commented on May 2, 2022

    @mikebessuille
    Contributor

    Consider for backporting to next PT patch as well

  5. 16 remaining items

  6. self-assigned this
    on Mar 2, 2024
  7. kevinushey commented on Mar 2, 2024

    @kevinushey
    Collaborator

    I'm seeing this issue again with R 4.3.2, but not sure if this is a regression in RStudio or a change in the latest R release that's causing trouble. Either way, I believe #14360 will resolve this issue.

  8. ronblum commented on Mar 13, 2024

    @ronblum
    Contributor

    @DavisVaughan Would you be able to check this in the latest dailies? It's working for me in RStudio Desktop 2024.04.0-daily+573, but I can't reproduce the problem in the first place.

  9. jgutman commented on Mar 13, 2024

    @jgutman
    Contributor

    FYI Davis is OOO until March 21

  10. added
    info needed
    on Mar 13, 2024
  11. assigned and unassigned on Mar 13, 2024
  12. added and removed
    info needed
    on Mar 19, 2024
  13. DavisVaughan commented on Mar 21, 2024

    @DavisVaughan
    Author

    It's working for me in 2024.04.0-daily+635

  14. kevinushey commented on Mar 21, 2024

    @kevinushey
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions