Skip to content

Issues with rendering of custom Source Markers #12425

Closed

Description

@gadenbuie

System details

RStudio Edition : Desktop [Open Source]
RStudio Version : 2023.3.0.14
OS Version      : OS X  12.5.1
R Version       : R version 3.6.3 (2020-02-29)

Steps to reproduce the problem

I think this is a regression; it was, at some point, possible to color and format source marker messages, but it no longer seems to be working as expected.

  1. Run this script to create a test script. It will open another R script.

    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)
  2. Run the opened R script to create the custom source markers.

  3. Problem: Observe that the markers do not appear in the current source file.

    image

  4. Click on a marker in the Markers pane. The file will open and the cursor will be on the line with the marker. Hover over the marker image.

    image

  5. Problem: The ANSI SGR colors of the marker text are escaped and appear in the message, rather than being applied to the message colors.

    image

Describe the problem in detail

See above

Describe the behavior you expected

I was expecting messages to be colored as described in #10062.

Activity

  1. added
    new
    on Dec 12, 2022
  2. removed
    new
    on Dec 13, 2022
  3. added this to the Cherry Blossom milestone on Dec 14, 2022
  4. self-assigned this
    on Feb 10, 2023
  5. ronblum commented on Feb 10, 2023

    @ronblum
    Contributor

    Verified in 2023.03.0-daily+312 on MacOS 13.2. The message is now displayed with the text in color instead of the escaped code.

    Image

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions