Skip to content

Add ability to set the numeric formatter precision with java debugger settings #745

Closed
@bhoppeadoy

Description

In VS Code, when debugging java files, float/double variables in "Variables" or "Debug Console" viewlet are truncated, giving us little ability to be able to quickly peek at variable values. For example, a double of value 0.00000033 is display as 0.000000

There's an already defined option for specifying the precision of floating format, we just need it exposed as a configuration setting. For example, there's an option to set the maxStringLength:

"java.debug.settings.maxStringLength"

Same behavior as this, but instead be able to set the NumericFormatter.NUMERIC_PRECISION_OPTION value, with something like this:

"java.debug.settings.numericPrecision" : 15

Environment
Operating System: Windows 10 (Windows_NT x64)
JDK version: java version "1.8.0_221"
Visual Studio Code version: 1.41.1
Java extension version: 0.55.1 (redhat.java)
Java Debugger extension version: 0.24.0 (vscjava.vscode-java-debug)

Steps To Reproduce
1.- Press F5 to start debugging session
2.- Go to VARIABLES panel and rigth click to show contextual menu on a variable
3.- Inspect a double variable that is expected to have a precision greater than 6 (i.e. 0.0000003)

Current Result
It will show as 0.000000

Expected Result
Show greater precision to see actual value, i.e. 0.0000003

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions