You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom diagnostics markers don't show in source code pane on Windows. #14297
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:
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:
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 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.
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.
Two separate issues here, neither is a recent regression.
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
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)
Activity
kevinushey commentedon Feb 20, 2024
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.
wklimowicz commentedon Feb 20, 2024
I see similar behaviour on Windows with one tab displaying
~/AppData/...and anotherC:/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.ronblum commentedon Feb 29, 2024
@gtritchie to investigate if this is a regression or a pre-existing bug.
gtritchie commentedon Mar 1, 2024
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:
For the Mac example,
/varis a symbolic link to/private/var, and again leading to the same sort of mismatch.gtritchie commentedon Mar 1, 2024
These problems repro'd with build 2022.07.0+548 so it's not a recent regression.
gtritchie commentedon Mar 15, 2024
Two separate issues here, neither is a recent regression.