Skip to content

Syntax highlighting in the output of tests explorer #17411

Open

Description

@diogo-rossi

Now that there will be a new announced built-in test tool for python,
it will be good that some good details of an old test explorer extension become available, like the syntax highlighting in the output of failed test, as show bellow:


This is the floating output of the ""old"" Python Test Explorer for Visual Studio Code.

We can see syntax highlighting and monospace font.

old


Any output of the new tool does not show syntax highlighting:

new

new2


Feature request

Show syntax highlighting in the output of failed tests in the new built-in tool of the tests.

Activity

  1. pralkarz commented on Sep 14, 2021

    @pralkarz

    I assume the fix isn't too difficult (hence the good first issue label), so would it be okay if I worked on this issue?

  2. pralkarz commented on Sep 17, 2021

    @pralkarz

    I worked on the issue and I managed to get syntax highlighting to work via VSCode's built-in Markdown engine, however there are two problems.

    1. You can't select (and, consequently, copy) the code unless you open it in the editor via the button in the top-right, which might be a bit inconvenient.
    2. For some reason the code blocks don't get rendered as-is and the whitespace is squashed similarly to the regular HTML, so the code isn't indented properly.
      image

    Sample code for a test message looks like this:

    const markdownText = new MarkdownString().appendCodeblock(text, "python");
    const message = new TestMessage(markdownText);

    Now I tried using non-breaking spaces ( ) and building the message manually without the MarkdownString.appendCodeblock method, but none of that worked. Maybe there is an issue with the VSCode's Markdown renderer?

  3. pralkarz commented on Sep 26, 2021

    @pralkarz

    Kindly bump.

    Please do tell me if this is rude. I'm still relatively new to open-source, so I'm not sure what's acceptable and what's not.

  4. diogo-rossi commented on Oct 8, 2021

    @diogo-rossi
    Author

    @ziebam Sorry for not to reply earlier.
    Sadly, I cant't help to develop extensions in VS Code. I just made the feature request.
    Maybe someone from the developers team could say something.

  5. pasumarty08 commented on Sep 16, 2022

    @pasumarty08

    Can I be assigned this issue please?

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions