atom / language-yaml

YAML package for Atom
Other
24 stars 39 forks source link

No folding for objects with list value without identation #99

Open amarao opened 6 years ago

amarao commented 6 years ago

Description

Folding does not work with objects containing lists which are on the same indentation as parent element.

Steps to Reproduce

Example of yaml file:

---
example:
- one
- two

Place cursor on 'example' and press 'fold' (Ctrl-Shift-[)

Expected behavior: Folding of 'example' element

Actual behavior: nothing happens

Reproduces how often: 100%

Versions

Atom : 1.23.2 Electron: 1.6.15 Chrome : 56.0.2924.87 Node : 7.4.0 apm 1.18.12 npm 3.10.10 node 6.9.5 x64 atom 1.23.2 python 2.7.14+ git 2.15.1

OS: Ubuntu 18.04 x86_64.

Additional Information

If yaml file has additional indentation, folding works.

---
example:
 - one
 - two

The problem is that most of yaml-generating software (python-yaml, jackson yaml, etc) generate yaml with no additional indentation for lists by default (as in the bugreport example).

50Wliu commented 6 years ago

This would require a tree-sitter grammar for intelligent folding.