Skip to content

Fix messed up regex to account for empty string form #10307

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

Merged
merged 2 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/10204.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix empty variables to show an empty string in the Notebook/Interactive Window variable explorer.
2 changes: 1 addition & 1 deletion src/client/datascience/jupyter/jupyterVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { JupyterDataRateLimitError } from './jupyterDataRateLimitError';
// kernels will add the ansi encoding.
const TypeRegex = /.*?\[.*?;31mType:.*?\[0m\s+(\w+)/;
const ValueRegex = /.*?\[.*?;31mValue:.*?\[0m\s+(.*)/;
const StringFormRegex = /.*?\[.*?;31mString form:.*?\[0m\s+([\s\S]+?)\n.*?\[.*?/;
const StringFormRegex = /.*?\[.*?;31mString form:.*?\[0m\s*?([\s\S]+?)\n(.*\[.*;31m?)/;
const DocStringRegex = /.*?\[.*?;31mDocstring:.*?\[0m\s+(.*)/;
const CountRegex = /.*?\[.*?;31mLength:.*?\[0m\s+(.*)/;
const ShapeRegex = /^\s+\[(\d+) rows x (\d+) columns\]/m;
Expand Down
2 changes: 1 addition & 1 deletion src/test/datascience/jupyterVariables.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ This is equivalent to (real + imag*1j) where imag defaults to 0.
truncated: true,
count: 0,
shape: '',
value: '(1+1j)',
value: ' (1+1j)',
supportsDataExplorer: false
};

Expand Down