Skip to content

Filelinks in error tracebacks no longer work #16045

Closed

Description

@t-kalinowski

System details

RStudio Edition : Desktop
RStudio Version : 
OS Version      : mac
R Version       : 4.5

RStudio 2025.08.0-daily+123 "Cucumberleaf Sunflower" Daily (e7cfc88, 2025-05-20) for macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2025.08.0-daily+123 Chrome/136.0.7103.93 Electron/36.2.1 Safari/537.36, Quarto 1.7.31 (/Applications/quarto/bin/quarto)

Steps to reproduce the problem

Raise an error from any function that includes a srcref. Attempt to click the source link.

For example, clicking source links like read-markdown.R#413 in the screenshot produces no action. This appears to be a recent regression.

Image

Describe the behavior you expected

Clicking the link should open the relevant source reference and focus on the corresponding text.

Minimal reprex

Run:

writeLines(c('\n\nfn <- function() {\n  stop("hi") \n}'), "bug.R")
source("bug.R")
fn()

Then click the link shown.

Image

Activity

  1. added
    new
    on May 20, 2025
  2. added theissue type on May 20, 2025
  3. self-assigned this
    on May 20, 2025
  4. added this to the Patch 2025.05.1 milestone on May 20, 2025
  5. kevinushey commented on May 21, 2025

    @kevinushey
    Collaborator

    I'm still not able to reproduce (using RStudio 2025.08.0 Build 128).

  6. kevinushey commented on May 21, 2025

    @kevinushey
    Collaborator

    Some bread crumbing:

    The handler for the click events on these source links lives here.

    That eventually fires an event on our global event bus to open that source file.

    RStudioGinjector.INSTANCE.getEventBus().fireEvent(
    new OpenSourceFileEvent(sourceFile,
    FilePosition.create(
    frame.getLineNumber(),
    frame.getCharacterNumber()),
    FileTypeRegistry.R,
    NavigationMethods.HIGHLIGHT_LINE));

    The registered handler for that should eventually get called here.

    public void onOpenSourceFile(final OpenSourceFileEvent event)
    {
    doOpenSourceFile(
    event.getFile(),
    event.getFileType(),
    event.getPosition(),
    null,
    event.getNavigationMethod(),
    false,
    event.getMoveCursor());
    }

    To confirm, objects of that class are registered as handlers in the constructor here.

    events_.addHandler(OpenSourceFileEvent.TYPE, this);

    It seems like something is getting lost somewhere in this chain.

  7. removed
    new
    on May 23, 2025
  8. ronblum commented on May 27, 2025

    @ronblum
    Contributor

    This is currently only working in RStudio Server.

    Works

    • RStudio Server 2025.05.1+508 on Ubuntu 24 via Edge on Windows 11

    Doesn't work

    • RStudio Desktop 2025.05.1+508 on MacOS 15 ARM
    • RStudio Desktop 2025.05.1+508 on Windows 11
  9. kevinushey commented on May 28, 2025

    @kevinushey
    Collaborator

    I'm going to prepare a debug build of RStudio to send over to @t-kalinowski to see if I can learn more about why it's failing for him.

  10. kevinushey commented on May 30, 2025

    @kevinushey
    Collaborator

    Chatted with @t-kalinowski and I think we've concluded this issue only occurs if the "Limit visible console output" preference is checked. Given this fact (and the fact that this preference is not enabled by default) I think we can punt this. (We plan to remove the virtualized console implementation in a future release, as it's no longer maintained.)

  11. ronblum commented on May 30, 2025

    @ronblum
    Contributor

    Sounds good. And confirmed--this explains why I saw the discrepancies above: I had also tried @astayleraz's reprex in #15877 to see what happens, and it starts off by setting the flag, so I unwittingly triggered the behavior. I see this happening earlier, in RStudio Desktop version 2024.09.0+375 on Windows 11, so agreed, not fixing for this patch.

    I'm going to move it back to triage so that we can decide whether to address this.

  12. removed this from the Patch 2025.05.1 milestone on May 30, 2025
  13. ronblum commented on Jun 9, 2025

    @ronblum
    Contributor

    This will be taken care of by #16104, slated for Cucumberleaf Sunflower.

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

Metadata

Metadata

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions