Skip to content

Feature request: Show properties for object #3

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

Open
fflaten opened this issue Apr 13, 2021 · 4 comments · May be fixed by #7
Open

Feature request: Show properties for object #3

fflaten opened this issue Apr 13, 2021 · 4 comments · May be fixed by #7

Comments

@fflaten
Copy link
Contributor

fflaten commented Apr 13, 2021

Awesome extension Tyler! 👏

Would it be possible to show properties for objects?

In the vscode api proposal issue they showed inline demo like varname = object { prop: value, anotherProp : array[2] }. Maybe we could show the default string-output format for pscustomobjects (ex output of "$((dir)[0] | select *)")

Or make inline-value show the referenced property-value. Currently shows variable "var" even if line only uses $var.SomeProp

@TylerLeonhardt
Copy link
Owner

This is a hard one because although varname = object { prop: value, anotherProp : array[2] } looks nice, one with 50 properties might not look as nice.

@weinand what do you think about this? I imagine there is a generic ask here since it would apply to any inline value variable lookup usages.

@fflaten
Copy link
Contributor Author

fflaten commented Apr 13, 2021

I agree with the length-issue for big objects. Just mentioned the @{Param=Value1;Param2=Value2} style since an equivalent in js was part of the api issue. Would probably get truncated too often to be useful, but maybe the someone will find a clever way to solve this in general for all languages.

That's why the second proposal was added since that might be more realistic in the near future. Maybe we can use InlineValueEvaluatableExpression for instances where accessing a property is detected?

@fflaten
Copy link
Contributor Author

fflaten commented Apr 13, 2021

Expression works for properties. Tested with a hardcoded pattern as PoC.

const rng = new vscode.Range(6, 10, 6, 28);
allValues.push(new vscode.InlineValueEvaluatableExpression(rng, '$files[0].FullName'));

image

@TylerLeonhardt
Copy link
Owner

Interesting... I guess we could support properties. That would be pretty nice!

@fflaten fflaten linked a pull request Apr 14, 2021 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants