microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
161.64k stars 28.4k forks source link

[json] Explorer Outline view shows wrong int values when viewing JSON document #136645

Open JGuebert opened 2 years ago

JGuebert commented 2 years ago

Issue Type: Bug

  1. Open a JSON file (observed issue with the JSON output retrieved from Twitter's API)
  2. In Explorer, expand the outline for the file
  3. Observe that not all values shown actually match those in the file (specifically, 'id' and 'id_str' in the file are identical for each item in statuses, but Outline shows them as two different values on almost all with 'id' not being accurate)

VS Code version: Code 1.61.2 (6cba118ac49a1b88332f312a8f67186f7f3c1643, 2021-10-19T14:57:20.575Z) OS version: Windows_NT x64 10.0.19043 Restricted Mode: Yes

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz (4 x 3392)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.91GB (9.69GB free)| |Process Argv|--crash-reporter-id a8b09d6d-25a7-465e-9bcf-4dcca82a0ffc| |Screen Reader|no| |VM|0%|
Extensions (4) Extension|Author (truncated)|Version ---|---|--- gitlens|eam|11.6.1 vscode-pull-request-github|Git|0.32.0 jupyter|ms-|2021.9.1101343141 jupyter-keymap|ms-|1.0.0
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythontb:30283811 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263:30335439 vscoreces:30384385 pythondataviewer:30285071 vscod805cf:30301675 pythonvspyt200:30340761 binariesv615:30325510 vsccppwt:30382697 bridge0708:30335490 pygetstartedt3:30385195 dockerwalkthru:30377721 bridge0723:30353136 pythonrunftest32:30373476 pythonf5test824:30373475 javagetstartedt:30391933 pythonvspyt187:30373474 vsqsis300:30386381 vsaa593cf:30376535 vssld246:30386377 ```
JGuebert commented 2 years ago

Issue observed with this JSON document.

image

tweets-1457573422205218818.txt

aeschli commented 2 years ago

The problem is that 1457573422205218818 can not be represented by a JavaScript number.

image

For the outline we can do a better job (no need to concert it a number and back to a string). But the large number asks for trouble and likely other users will run into issues too.