-
Notifications
You must be signed in to change notification settings - Fork 146
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
Any object with more than two levels is truncated #1819
Comments
I believe this is by design. Copy in the debugger copies the |
If you want more to be displayed, you have to change the Something like this: class A():
def __init__(self):
self.a = 1
self.b = 2
self.c = 3
def __repr__(self):
return f"A(a={self.a}, b={self.b}, c={self.c})"
a = A()
dict = {"a": a, "b": list}
print(dict) |
Can you share your code? It seems weird that you'd get '[...]' in the value for a variable unless it was really deep into iteration. At the first level I don't think it should show just I'm thinking maybe the problem here isn't copying but rather the gathering of the value itself. |
It comes down to this constant here:
If an object is more than two levels deep (the size of the tuple), it just truncates it. This seems unnecessary to me but changing it could affect the perf of a lot of stuff. Maybe we'd need a setting to allow this to be controlled by the user. |
I have no objection to the representation in the debug panel being truncated, by the way. It's just that it's not useful that when you copy it, it doesn't copy the whole object |
Changing the copy eval to use a different truncation might be possible. On the eval for the copy we get a 'clipboard' context. That seems like it would be hard to know it's going to behave that way though. It would just be more information for some reason. And it might be slow too if we always had the clipboard eval expand everything. I think I'd want a way for the user to specify how much data we expand. |
Potentially a duplicate of issue(s): #1644 |
Type: Bug
Behaviour
Clicking "Copy value" in the variables context menu leads to the presented object being copied as-is, i.e. truncated.
I have tested the JS debugger and it does not exhibit the same behaviour.
Steps to reproduce:
For example, trying to copy this dictionary:
leads to the clipboard containing this ellipsis
instead of the actual dictionary.
Diagnostic data
launch.json
configurationOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)N/A
Output for
Python Debugger
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython Debugger
)N/A
Extension version: 2024.14.0
VS Code version: Code 1.96.2 (fabdb6a30b49f79a7aba0f2ad9df9b399473380f, 2024-12-19T10:22:47.216Z)
OS version: Linux x64 5.14.0-503.21.1.el9_5.x86_64
Modes:
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
webnn: unavailable_software
The text was updated successfully, but these errors were encountered: