atom / language-yaml

YAML package for Atom
Other
24 stars 39 forks source link

YAML highlighting of value portion of key-value for non-quoted, non-multiline strings continues onto next line erroneously #78

Closed BlaineEXE closed 6 years ago

BlaineEXE commented 7 years ago

Prerequisites

Description

[Description of the issue]

YAML highlighting for a key's value continues onto the next line when it is a simple, non-quoted string (not a list, another key, a multiline string (with | or >), etc, and the highlighting should not continue.

Simple test case in YAML file to reproduce


this: key
is
highlighted
over
arbitrary
number
of
lines

Expected behavior: [What you expect to happen] When using a simple, non-quoted string in YAML, I expect the next line's content to not be highlighted unless it is a quoted string, a list, a multiline string (with | or >), etc. In the example, 'is' begins a line that violates YAML's syntax. One suggestion that this case is the correct one is that trying to load a test yaml file in Python with the text will throw an error with the text could not find expected ':' on the example line "is".

Actual behavior: [What actually happens] YAML highlighting for a key's value continues onto the next line when it is a simple, non-quoted string (not a list, another key, a multiline string (with | or >), etc. See image below.

image

Reproduces how often: [What percentage of the time does it reproduce?] Always

Versions

atom --version Atom : 1.14.4 Electron: 1.3.13 Chrome : 52.0.2743.82 Node : 6.5.0

apm --version apm 1.15.3 npm 3.10.5 node 4.4.5 x64 python 2.7.13 git 2.12.0

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

50Wliu commented 7 years ago

So yes, this is an issue. However, it is a very difficult issue to fix. I've made some (non-visible) progress with it in #74.

BlaineEXE commented 7 years ago

Thank you! I believe this issue is the root behind support for Jinja2 highlighting in YAML files: https://github.com/danielchatfield/atom-jinja2/issues/22

Update: Just installed language-yaml 0.29, and YAML with Jinja now highlights properly. Thank you, @50Wliu !

jerowe commented 6 years ago

I either have a similar or the same issue.

yaml-syntax-highlighting

Syntax highlighting for a multiline string continues after the multiline string.

It happened very shortly after I updated all my atom packages, but I'm not sure what version I was on before.

➜  atom atom --safe
➜  atom atom --version
Atom    : 1.22.1
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0
➜  atom apm --version
apm  1.18.8
npm  3.10.10
node 6.9.5 x64
python 2.7.13
git 2.11.0

I also moved all of my ~/.atom to ~/.atom-backup.

russianryebread commented 6 years ago

I have a similar issue, though it's also erroneously highlighting a hidden char (space)

screen shot 2018-02-01 at 12 55 00 pm
Atom    : 1.23.3
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0