question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debug watched array item is shown as an empty string

See original GitHub issue

Fully described here: https://github.com/Microsoft/vscode/issues/72433

Debugging PowerShell: an array value is shown as an empty string on the left but it’s plainly not empty on hover or under locals:

System Details

VSCode version:

1.33.1 51b0b28134d51361cf996d2f0a1c698247aeabd8 x64

VSCode extensions:

  • Fr43nk.seito-openfile@1.8.5
  • ms-vscode.powershell@1.12.1
  • rozzzly-dev.vscode-prompt-debug@0.0.2

PSES version: 1.12.1.0

PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.16299.820
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.820
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

I am experiencing a problem with watching an item in a (large) array - the value is not displayed correctly (at all). image

Expected Behaviour

Should be seeing the array value

Actual Behaviour

Array item is displayed as the empty string "" but only on the left. Elsewhere (hover, locals) it’s displayed correctly

image

NOTE: I have verified this bug with all extensions (except the PowerShell extension of course) disabled.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
cawoodmcommented, Apr 24, 2019

image

image

image

You might also notice the + in Watch is grayed out so I can’t add new watches. To be honest the whole Variables function is very dodgy/buggy and I have to often restart VSCode to get it to behave.

0reactions
noambonniecommented, Apr 23, 2019

@noambonnie That looks like Go rather than PowerShell. Is this in the PowerShell extension?

Oops apologies. You’re correct. I don’t know how I ended up here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

View array in Visual Studio debugger? - c++ - Stack Overflow
You can try this nice little trick for C++. Take the expression which gives you the array and then append a comma and...
Read more >
How to Check if a JavaScript Array is Empty or Not with .length
To check if an array is empty or not, you can use the .length property. The length property sets or returns the number...
Read more >
shell script - If Bash arrays can't contain a null string, how does ...
Why am I unable to see the null string when I use a regular for loop, but I can see it when I...
Read more >
How to Check if an Array Is Empty in VBA
Just like how we used the split function to split a string into an array, a Join function can be used to concatenate...
Read more >
Set a watch on variables - Visual Studio (Windows)
While you debug, see variables and expressions in Watch and QuickWatch. Watch can display several variables, QuickWatch only one, and only ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found