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

Not all properties are displayed during debug in the Variable panel #821

Closed
mrboring opened this issue Jun 1, 2017 · 11 comments
Closed
Assignees
Labels
Milestone

Comments

@mrboring
Copy link

mrboring commented Jun 1, 2017

System Details

  • Operating system name and version: Windows 7 x64 [6.1.7601]
  • VS Code version: 1.12.2
  • PowerShell extension version: 1.2.0
  • Output from $PSVersionTable:
    PSVersion 5.1.14409.1005
    PSEdition Desktop
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
    BuildVersion 10.0.14409.1005
    CLRVersion 4.0.30319.42000
    WSManStackVersion 3.0
    PSRemotingProtocolVersion 2.3
    SerializationVersion 1.1.0.1
Copy / paste the below commands into the PowerShell Integrated Terminal, and paste the output here

code -v
1.12.2
19222cdc84ce72202478ba1cec5cb557b71163de

$pseditor.EditorServicesVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
1      2      0      0

code --list-extensions --show-versions
ajhyndman.jslint@1.2.1
ms-vscode.PowerShell@1.2.0
saviorisdead.Theme-GitHubCleanWhite@0.0.3

$PSVersionTable
PSVersion                      5.1.14409.1005
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1005
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

I have the following code:

Clear-Host

$x = Get-ChildItem -Path C:\Miscellaneous

$x

I set a breakpoint on the $x line. In the Variables panel I expanded the $x variable. For each entry the following properties are missing:
PSPath
PSParentPath
PSChildName
PSDrive
PSProvider
PSIsContainer
Mode
BaseName
Target
LinkType

The following properties are displayed:
Name
Parent
Exists
Root
FullName
Extension
CreationTime
CreationTimeUtc
LastAccessTime
LastAccessTimeUtc
LastWriteTime
LastWriteTimeUtc
Attributes

Attached Logs

I tried to attach the log, but was continually told that We don’t support that file type. Strange as it was created Send to > Compressed (zipped) folder. I can expand it with 7-zip.

@rkeithhill
Copy link
Contributor

Verified. Looks like we are getting the properties of the base object and not the extended properties of the PSObject.

@rkeithhill rkeithhill self-assigned this Jun 1, 2017
@daviwil
Copy link
Contributor

daviwil commented Jun 1, 2017

How hard is the fix? Think we can get it in today? Planning to ship an update at some point during the day so we could fit it in.

@rkeithhill
Copy link
Contributor

Don't know yet. Looking at the code.

@rkeithhill
Copy link
Contributor

Testing.

@rkeithhill
Copy link
Contributor

rkeithhill commented Jun 1, 2017

I have a fix that adds in NoteProperty. Can't do ScriptProperty (for BaseName) or CodeProperty (for Mode/LinkType/Target) because I have a limitation at the moment where I can't get at these:

// This exception occurs when accessing the value of a
// variable causes a script to be executed.  Right now
// we aren't loading children on the pipeline thread so
// this causes an exception to be raised.  In this case,
// just return an empty list of children.

Do we want AliasProperty? I'm inclined not to add these as they just refer to other properties and they are more for end users (not folks debugging).

@daviwil
Copy link
Contributor

daviwil commented Jun 1, 2017

NoteProperty is probably good enough. I agree with your justification for the others!

@daviwil
Copy link
Contributor

daviwil commented Jun 1, 2017

Oh and yeah, I don't see a need for AliasProperty until someone asks for it.

@mrboring
Copy link
Author

mrboring commented Jun 2, 2017

Thanks for the quick fix, it's much appreciated. I can confirm it's working as you specified. All NoteProperty are available, and CodeProperty and ScriptProperty are not.

As it happens when I was using VS Code it was the BaseName property that I was looking for, that's how I noticed that properties were missing. For now I can just add a WATCH for BaseName. However, someone new to PowerShell might not know the missing properties are available.

I would hope that, at some point in the future, all properties were available. I'm trying to move away from the ISE, but I'm struggling at the moment. VS Code has lots of extra, really useful, functionality, but is missing feature parity with ISE. I'm looking forward to the day when I can just use VS Code.

@daviwil
Copy link
Contributor

daviwil commented Jun 2, 2017

What else is the PowerShell extension and VS Code missing for ISE parity? There isn't a variables view in the ISE by default, so I'm guessing you've been using ISE Steroids there? Definitely interested to hear where we don't match up against the base ISE experience.

I've filed issue #826 to track the need for ScriptProperty and CodeProperty properties.

@mrboring
Copy link
Author

mrboring commented Jun 2, 2017

@daviwil When mentioning missing functionality I was not referring to the Variables panel. I was thinking of functionality such as Write-Progress and PSReadLine. I believe both of these are on the way.

By the way, I don't use ISE Steroids. I tried it, but found it slowed the ISE down too much.

With regard to the Variables panel, I'm used to the ISE (or PowerShell prompt). If I run (Get-ChildItem)[0] | fl * I will see all the properties, regardless of type. Like I said above, if some of the properties are not there, then this could lead to confusion. As it did for me when I noticed that BaseName was missing. This is not helpful for users new to PowerShell. Thanks for creating #826.

I'm at the tipping point. My intention is to try using VS Code as my primary IDE. I'm aware that not all functionality is currently there, but there is functionality that isn't available in ISE (variables panel, refactoring, etc.

This is not a critcism, but feedback. I greatly appreciate the work you've done on the PowerShell extension.

@daviwil
Copy link
Contributor

daviwil commented Jun 2, 2017

Thanks a lot for giving it a shot as your main IDE! I really appreciate your feedback, feel free to file issues for anything else you find that's missing or not up to par.

The other features you mentioned you are definitely on the way, I'm finishing up some preliminary work now that will make it much easier to address the lack of Write-Progress and PSReadline. My hope is that the PSReadline support will be added by the end of June, but that might require some pending PSReadline changes to be merged first.

At any rate, the extension will continue to improve quickly over the next few months :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants