question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Arrays of objects are not split up in the yaml outline

See original GitHub issue

Here is an example image: https://cl.ly/0d3J3r3R202l

The text:

init_config:
  
instances:
  - name:  words
    url:   http://localhost:8080/
    http_response_status_code: 200
    timeout: 5
    skip_event: true
    tags:
      - name:words
      - type:app
      - env:prod
  - name:  words2
    url:   http://localhost:8081/
    http_response_status_code: 200
    timeout: 5
    skip_event: true
    tags:
      - name:words2
      - type:app
      - env:prod

instances just appearing as an array with a bunch of duplicate values. http://yaml-online-parser.appspot.com/ seems to correctly parse this as:

{
  "instances": [
    {
      "http_response_status_code": 200, 
      "name": "erights http://localhost:8080/", 
      "timeout": 5, 
      "tags": [
        "name:erights", 
        "type:app", 
        "env:prod"
      ], 
      "url": "http://localhost:8080/", 
      "skip_event": true
    }, 
    {
      "http_response_status_code": 200, 
      "name": "erights http://localhost:8080/", 
      "timeout": 5, 
      "tags": [
        "name:erights", 
        "type:app", 
        "env:prod"
      ], 
      "url": "http://localhost:8080/", 
      "skip_event": true
    }
  ], 
  "init_config": null
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JPinkneycommented, Feb 19, 2020

This should work now as we’ve implemented hierarchical document symbols.

0reactions
JPinkneycommented, Jul 31, 2018

In order to get what I’m looking for I’d have to make some kind of dummy object for each element of the array to get it represented in the hierarchy

That would have to be done on this extensions side not on your side.

I feel like just having the object symbol with no name and a dropdown would be a fine workaround and still be pretty clear.

Perhaps that could work. Though i’m not entirely sure if the language server protocol states whether or not the text should be empty strings or not. Additionally, the regular document symbols (ctrl+shift+o for me on VSCode i’m not sure if thats the default or not though) would just have an empty text field for those objects which wouldn’t be really helpful. I’ll play around with it and see.

Read more comments on GitHub >

github_iconTop Results From Across the Web

YAML equivalent of array of objects in JSON - Stack Overflow
The equivalent of a JSON array in YAML is a sequence, which looks like either of these (which are equivalent): # flow style...
Read more >
Variables in YAML pipeline are not allowing to define array
Based on the docs I should be able to define any content for the variable in YAML pipeline, but when I try this,...
Read more >
Render of YAML array is not using minItems and maxItems ...
Use an array definition of a schedule in YAML that uses minItems of 2 and maxItems of 2. When rendered in GitLab it...
Read more >
YAML Tutorial: Everything You Need to Get Started in Minutes
False is indicated with False, Off, or No. --- foo: True bar: False light: On TV: Off. Arrays. You can specify arrays or...
Read more >
Comprehending YAML - chan.dev
The dashes - indicate that the root structure is an array (sequence). But each array item comprises a descrete object (mapping) with a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found