Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode interactive window: string variables with newline / space characters not shown correctly while inspecting [Jupyter: Variables] #8693

Closed
abgoswam opened this issue Jan 11, 2022 · 5 comments · Fixed by #12380
Assignees
Labels
feature-request Request for new features or functionality variable-explorer
Milestone

Comments

@abgoswam
Copy link
Member

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.63.2
  • OS Version: Windows11 enterprise

Steps to Reproduce:

  1. open a interactive window, and type a simple string with newlines/space characters:
str_with_newlines = "[   line1]\n[line2    ]\n[    line3    ]"

Expectation:

if we use [Jupyter:variables] tab to inspect the value of that variable, it should show the newlines/space characters present in the string

What is actually shown:

image

this is misleads the user into thinking there are no newlines in the string. also note how spaces are not shown correctly

Couple of notes:

  1. if we use debug to inspect the variable, it is shown with the spaces/newlines correctly:

image

So the issue seems to be with the vscode interactive window's way of displaying value of variables

  1. comparing with PyCharm IDE, it seems PyCharm also renders the variable correctly with proper rendering of newline/space character :

image

@ghost ghost assigned rebornix Jan 11, 2022
@rebornix rebornix transferred this issue from microsoft/vscode Jan 13, 2022
@rebornix rebornix assigned amunger and unassigned rebornix Jan 13, 2022
@amunger
Copy link
Contributor

amunger commented Jan 13, 2022

thanks for the bug, I am able to repro

@IanMatthewHuff IanMatthewHuff removed their assignment Jan 13, 2022
@greazer greazer added bug Issue identified by VS Code Team member as probable bug interactive-window Impacts interactive window variable-explorer and removed needs-triage interactive-window Impacts interactive window labels Jan 13, 2022
@greazer greazer added this to the February 2022 milestone Jan 13, 2022
@greazer greazer modified the milestones: February 2022, On Deck Feb 4, 2022
@IanMatthewHuff IanMatthewHuff removed their assignment Nov 10, 2022
@roblourens roblourens self-assigned this Dec 10, 2022
@amunger amunger added the verified Verification succeeded label Jan 25, 2023
@amunger
Copy link
Contributor

amunger commented Jan 25, 2023

this doesn't look right - it makes it seem like the first line is the complete value
image

@amunger amunger removed the verified Verification succeeded label Jan 25, 2023
@amunger amunger added the verification-found Issue verification failed label Jan 25, 2023
@amunger amunger reopened this Jan 25, 2023
@roblourens
Copy link
Member

roblourens commented Jan 26, 2023

It drives me nuts to show escaped newlines like this, because the string \\n\n would be rendered \n\n. I think that what it does now is the correct behavior and matches js-debug. I think you can hover to see the full thing. But I can consider this next month.

@amunger
Copy link
Contributor

amunger commented Jan 26, 2023

hovering shows the same value, just '[ line1]'.
It would be nice to have some indication that the value shown is not complete, even just dropping the trailing' character, similar to when a variable is too long on a single line:
image

@roblourens roblourens modified the milestones: February 2023, March 2023 Feb 21, 2023
@roblourens roblourens modified the milestones: March 2023, April 2023 Mar 21, 2023
@roblourens roblourens modified the milestones: April 2023, May 2023 Apr 26, 2023
@roblourens roblourens modified the milestones: May 2023, On Deck May 31, 2023
@DonJayamanne DonJayamanne added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug verification-found Issue verification failed labels Dec 13, 2023
@rebornix rebornix assigned amunger and unassigned roblourens Dec 13, 2023
@amunger
Copy link
Contributor

amunger commented Dec 14, 2023

closing in favor of microsoft/vscode#165445

@amunger amunger closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality variable-explorer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants