atom / language-yaml

YAML package for Atom
Other
24 stars 39 forks source link

Alternative boolean representations with wrong highlighting #81

Closed yajo closed 7 years ago

yajo commented 7 years ago

Prerequisites

Description

Atom only highlights true and false as booleans. YAML has many other ways to write those booleans.

Steps to Reproduce

Write this:

highlight_examples:
    good:
        - true
        - false
    bad:
        - y
        - Y
        - yes
        - Yes
        - YES
        - n
        - N
        - no
        - No
        - NO
        - True
        - TRUE
        - False
        - FALSE
        - on
        - On
        - ON
        - off
        - Off
        - OFF

Expected behavior: All of those values highlighted as booleans.

Actual behavior: Only true and false work:

captura de pantalla de 2017-04-25 11-31-57

Reproduces how often: 100%

Versions

➤ atom --version
Atom    : 1.16.0
Electron: 1.3.13
Chrome  : 52.0.2743.82
Node    : 6.5.0

➤ apm --version
apm  1.16.1
npm  3.10.5
node 6.9.5 x64
python 2.7.13
git 2.9.3

➤ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description:    Fedora release 25 (Twenty Five)
Release:    25
Codename:   TwentyFive
winstliu commented 7 years ago

The YAML spec only recognizes true and false as booleans.

Edit: wrong link, it actually also recognizes True, False, TRUE, and FALSE. http://yaml.org/spec/1.2/spec.html#id2805071

yajo commented 7 years ago

Hmm yes, you're right. It seems the other booleans are just a recommendation, not a requirement (although I have been able to use them everywhere).