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

Better support for displaying objects #11

Open
T-vK opened this issue Jul 30, 2020 · 4 comments
Open

Better support for displaying objects #11

T-vK opened this issue Jul 30, 2020 · 4 comments

Comments

@T-vK
Copy link

T-vK commented Jul 30, 2020

It would be nice if objects would be displayed in a better way. For example:
image

As you can see, the object in variable a is displayed as A a foo: bar foofoo: Object in the Watches window.
It would be nice to have them displayed in a more readable way. At the moment the best I can do is to add a watch like JSON.stringify(a). But I would much rather have something like JSON.stringify(a, null, " "), but whenever I try it it gets converted into JSON.stringify(a, n\a.
image

I don't know what the capabilities or limitations of vim are, but it would be nice to be able to unfold objects like this:
image

@eliba2
Copy link
Owner

eliba2 commented Jul 30, 2020

Youre right its in the roadmap (Watches / Open/Close properties).
I'm not familiar with any standard implementation for such component in (n)vim, it has to be created from scratch.

@amit777
Copy link

amit777 commented Mar 27, 2021

No idea, but maybe https://github.com/elzr/vim-json can help? It seems to have folding capabilities around JSON

@amit777
Copy link

amit777 commented Mar 27, 2021

Also, after more searching, i came across https://github.com/puremourning/vimspector but haven't tried it yet. It seems to have object expansion/folding in its screenshot UI. Maybe it would be helpful as well.

@eliba2
Copy link
Owner

eliba2 commented Mar 28, 2021

Thanks,
I've also looked at these before in my research, they don't really fit unless doing some serious modifications. Note a component for displaying the variables must be dynamic - some properties might fold, some not (assume a multi level object, the debugger will not unfold all at once which might be too large). Also there might be some large lists which need to be folded in parts.
I've decided to write my own, if it'll be nice decoupled I'll publish it as a stand alone.

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

No branches or pull requests

3 participants