Skip to content

Custom diagnostics markers don't show in source code pane on Windows. #14297

Open

Description

@wklimowicz

System details

RStudio Edition : Desktop
RStudio Version : 2023.12.1 Build 402
OS Version      : Windows 11 Enterprise 23H2
R Version       : 4.3.2

Steps to reproduce the problem

Copying the helpful reprex from #12425, but the error is the same as #10062:

tmpfile <- tempfile(fileext = ".R")

writeLines(con = tmpfile,
'foo <- cli::bg_br_white(cli::col_red("I am red!"))
bar <- cli::bg_br_yellow(cli::col_cyan("I am cyan!"))

markers <- list(
  list(
    type = "error",
    file = tmpfile,
    line = 6,
    column = 1,
    message = foo),
  list(
    type = "info", 
    file = tmpfile,
    line = 12,
    column = 1,
    message = bar))

rstudioapi::sourceMarkers("Test Name", markers)
'
)

file.edit(tmpfile)

Describe the problem in detail

Custom markers should show up in the source code pane, but don't currently on Windows 11:
image

This issue doesn't show up on Fedora 39 with the same RStudio version. My Windows machine is a work PC so I can't test this on the development version of RStudio on windows.

Describe the behavior you expected

Markers to show up next to the source code as in #10062:

image

My goal is to display lintr style diagnostics in the source code pane, which don't show up in either Fedora or Windows. This might be linked to this issue, but happy to put in a separate feature request if not showing lintr diagnostics is intended behaviour.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on Feb 19, 2024
  2. kevinushey commented on Feb 20, 2024

    @kevinushey
    Collaborator

    I'm seeing a somewhat related issue on macOS; it seems like I get two copies of the same file open, but with different paths to that file recorded.

    Screenshot 2024-02-20 at 10 50 16 AM Screenshot 2024-02-20 at 10 50 23 AM
  3. removed
    new
    on Feb 20, 2024
  4. wklimowicz commented on Feb 20, 2024

    @wklimowicz
    Author

    I see similar behaviour on Windows with one tab displaying ~/AppData/... and another C:/Users/WKLIMO~1/AppData/.... Neither of them show the markers though, even though the marker pane is showing the identical file name to the ~/AppData/... version.

  5. ronblum commented on Feb 29, 2024

    @ronblum
    Contributor

    @gtritchie to investigate if this is a regression or a pre-existing bug.

  6. gtritchie commented on Mar 1, 2024

    @gtritchie
    Member

    There may be multiple issues at play here.

    In my real Windows account (username "gary") when I run the scenario described I end up with only one temp file opened (as it should be). The markers don't display initially but as soon as I double-click on one in the markers pane, they show up in the editor gutter. I assume they should display without having to do that.

    The scenarios with two tabs opening for the temp file are due to paths not being properly normalized. On Windows that happens if the user account name (thus the profile folder) isn't 8.3 DOS compatible (super-fun that this is still a factor; 1981 called and wants its filenames back).

    For example, I created a local Windows account named "Longer User Name". In this account, clicking on the markers opens a second tab (and shows the markers in it), with these paths:

    C:/Users/LONGER~1/AppData/Local/Temp/Rtmpae7JdW/file59bc14cc7f71.R
    C:/Users/Longer User Name/AppData/Local/Temp/Rtmpae7JdW/file59bc14cc7f71.R
    

    For the Mac example, /var is a symbolic link to /private/var, and again leading to the same sort of mismatch.

  7. gtritchie commented on Mar 1, 2024

    @gtritchie
    Member

    These problems repro'd with build 2022.07.0+548 so it's not a recent regression.

  8. gtritchie commented on Mar 15, 2024

    @gtritchie
    Member

    Two separate issues here, neither is a recent regression.

    1. Inconsistent path normalization (leading to the same file being opened twice, due to symbolic links on Mac/Linux and short filenames on Windows): I repro'd this back to 1.4 (didn't try any older) so not a recent regression
    2. The markers do not show up in the source pane until I double-click on one in the Markers pane (repro'd this back to 2022.07.2+576)
  9. removed their assignment
    on Mar 15, 2024
  10. added this to the Later milestone on Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions