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

View and copy toString() of objects in the VARIABLES and WATCH windows #1264

Open
crowmagnumb opened this issue Nov 24, 2023 · 3 comments
Open
Assignees
Labels

Comments

@crowmagnumb
Copy link

Suggestion

The ability to see the results of at least the toString() of a variable in both the VARIABLES and WATCH sections of the debugger.

Use Cases

I just recently switched to using VSCode for my Java debugging (from Eclipse) and one thing I always did in Eclipse was put a breakpoint to check my SQL out when there was an issue. I have an SQLStatement object that allows you to build an SQL string from constituent parts. It's toString() method produces the SQL to send to the db. So when I want to test that out I put a breakpoint and evaluate the toString(). Usually copying and pasting it into my db command-line i/f for testing and editing. But in VSCode I can´t seem to do that.

I only see the first few characters as can be seen in the screenshot. "SELECT id..." and if I right-click and choose "Copy Value" I get that exact same expression with double-quotes and ellipsis! Can this please just give the full value of the string?

Examples

image

@nickzhums
Copy link
Member

Thanks for reporting this! @testforstephen could you please take a look at this one, do we automatically omit the value of the variable?

@testforstephen
Copy link
Contributor

@crowmagnumb Have you changed the user setting "java.debug.settings.maxStringLength"? If so, you can change it to "java.debug.settings.maxStringLength": 0, that will show the full text.

Also I see a room to improve this case. No matter what value is set in the maxStringLength, it should return the full text if users want to copy the variable value.

@crowmagnumb
Copy link
Author

crowmagnumb commented Nov 27, 2023

@testforstephen Thank you! I was looking for some setting like that but couldn't find it. That is a great improvement but a couple of things. One, it gives me the quotes when I say Copy Value so I have to go to the front and the end of the copied text to delete them before sending it to my SQL server, which is a bit annoying. Also it might be nice if it was somewhere persistent on the screen rather than just in the pop-up dialog, move my mouse slightly and it disappears. But that's not the most important, the copying of just the value and not the quoted value would be great!

And as you said, I think it should give you the whole string when you copy it (without quotes) no matter what your setting for this is.

But Thank You! This will work for me! Cheers.

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