-
Notifications
You must be signed in to change notification settings - Fork 235
Display variable's type name #72
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
Labels
Issue-Enhancement
A feature request (enhancement).
Comments
I think this will be really useful, and I'd go with the "type name or ToString() if different" option as well. Thanks Keith! |
rkeithhill
added a commit
to rkeithhill/PowerShellEditorServices
that referenced
this issue
Dec 12, 2015
…mething useful. This is typically the short type name. However, for rank 1 arrays and objects implementing ICollection we now also display the number of items in the array/collection. Also changed objects of type string to display their value in double quotes.
Looks fantastic man! Checking out the PR now |
daviwil
added a commit
that referenced
this issue
Dec 12, 2015
Addresses proposal #72 - for expandable objects, display something us…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Visual Studio uses a three column grid to display a variable's name, value and type name. In VSCode we have a tree view and the tool window it is in is typically narrow. It is common to display variable name followed by its value. However PowerShell quite often has objects (composite variables) where the current variables display shows no value for objects.
I propose is that for expandable objects, we take advantage of the opportunity to display something. One option is the variable's short type name e.g.:
Of course since we've chosen to prefix variables with

$
then perhaps we display type names using PowerShell syntax:Another variation is to test the expandable object's ToString() return and if it is different than the type name, then display that instead. Here's an example of where this is useful. I can see the useful value of

$pwd
without having to open the node:In this case, I think seeing the path (ToString() value) is more useful than seeing
[PathInfo]
.What are your thoughts on this? The implementation is a trivial change to VariableDetails.cs. Personally, I'm leaning towards the last example of using either the type name or
ToString()
if it is different.The text was updated successfully, but these errors were encountered: