microsoft / vscode

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

[json] Outline View displays array of objects as duplicated keys of object #53605

Closed nihonjinrxs closed 6 years ago

nihonjinrxs commented 6 years ago

Issue Type: Bug

Steps to replicate

  1. Turn on outline view.
  2. Create a simple JSON file as follows:
    {
    "MyArray": [
    {
      "name": "Object 1",
      "_id": 1,
      "data": [
        "a",
        "b",
        "c"
      ]
    },
    {
      "name": "Object 2",
      "_id": 2,
      "data": [
        "d",
        "e",
        "f"
      ]
    },
    {
      "name": "Object 3",
      "_id": 3,
      "data": [
        "g",
        "h",
        "i"
      ]
    }
    ],
    "OtherKey": "Some data",
    "ObjectKey": {
    "ObjectData1": "Data 1",
    "ObjectData2": 2
    }
    }
  3. Look at the Outline View display, and notice how keys within the objects that are part of "MyArray" are included as object keys under the "MyArray" heading. These should instead be displayed as individual objects with keys of the array index, or similar.

Screenshot

(Auto-included info)

VS Code version: Code 1.24.1 (24f62626b222e9a8313213fb64b10d741a326288, 2018-06-13T17:41:50.128Z) OS version: Darwin x64 17.4.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz (8 x 2800)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|3, 3, 2| |Memory (System)|16.00GB (1.72GB free)| |Process Argv|/Applications/Visual Studio Code.app/Contents/MacOS/Electron -psn_0_53261| |Screen Reader|no| |VM|0%|
Extensions (52) Extension|Author (truncated)|Version ---|---|--- rainbow-brackets|2gu|0.0.6 vscode-markdownlint|Dav|0.18.0 gc-excelviewer|Gra|2.1.24 beautify|Hoo|1.3.2 r-lsp|Iku|0.0.7 elixir-ls|Jak|0.2.19 latex-workshop|Jam|5.5.1 vscode-docker|Pet|0.0.27 alda-vscode|abh|0.0.2 vscode-database|baj|1.5.1 solargraph|cas|0.17.4 gotemplate|cas|0.2.0 brightscript|cel|1.0.1 npm-intellisense|chr|1.3.0 regex|chr|0.2.0 jshint|dba|0.10.19 vscode-eslint|dba|1.4.12 vscode-dash|dee|1.10.0 tslint|eg2|1.0.33 vscode-npm-script|eg2|0.3.4 vscode-great-icons|emm|2.1.36 mdmath|goe|2.2.1 r-check|hku|0.0.1 r-vscode-tools|hku|0.0.3 r-development|Hri|1.0.0 rest-client|hum|0.19.0 elixirlinter|iam|0.4.1 r|Iku|0.6.0 Ionide-fsharp|Ion|3.22.1 vscode-rust|kal|0.4.2 graphql-for-vscode|kum|1.12.0 terraform|mau|1.2.3 rainbow-csv|mec|0.4.2 ruby-rubocop|mis|0.7.0 roku-deploy-vscode|mjm|0.0.4 vscode-elixir|mjm|1.1.0 python|ms-|2018.6.0 azure-account|ms-|0.4.1 Go|ms-|0.6.84 node-debug2|ms-|1.19.0 debugger-for-chrome|msj|4.7.0 indent-rainbow|ode|7.2.2 heroku-command|pko|0.0.8 Ruby|reb|0.17.0 java|red|0.28.0 prettier-now|rem|1.4.9 vscode-icons|rob|7.24.0 vscode-elixir-formatter|sam|0.2.0 searchdocsets-vscode|sil|1.0.1 react-beautify|tai|0.3.0 vscode-react-native|vsm|0.6.11 ReactSnippets|xab|2.2.0 (1 theme extensions excluded)
jrieken commented 6 years ago

That's how the data is received from the extension.

nihonjinrxs commented 6 years ago

Thanks! Much appreciated!