atom / language-yaml

YAML package for Atom
Other
24 stars 39 forks source link

Strings with (assumed) embedded jinja tags break syntax highlighting. #104

Closed mar10 closed 2 years ago

mar10 commented 6 years ago

Description

Strings with (assumed) embedded jinja tags break syntax highlighting.

In the following example I tried to define a logger format the should display a thread id (%(thread)d)) inside angled brackets (<...>)

logger_format: "%(asctime)s.%(msecs)03d - <%(thread)d)> %(name)-27s %(levelname)-8s:  %(message)s"

image

My guess is, that <% is evaluated as an opening jinja template, that never get's closed?

Versions

Atom : 1.27.2 Electron: 1.7.15 Chrome : 58.0.3029.110 Node : 7.9.0 macOS & Windows

winstliu commented 6 years ago

Yes, you're absolutely right. It treats <% %> as embedded Ruby. Unfortunately, short of removing those patterns, there's nothing we can do to fix this right now.

mar10 commented 6 years ago

I see, thank you. Just for my understanding: why does a generic YAML highlighter assume ERB usage? Also, wouldn't it make sense to assume the <% to be ended (concerning highlighting) when the string ends?

winstliu commented 6 years ago

Great questions! This language package was converted from the Textmate version, which at the time also had those Ruby patterns. We haven't touched that part since.

It definitely would make sense for the highlighting to be ended when the string ends, but unfortunately that's blocked on atom/first-mate#83.

mar10 commented 6 years ago

Understood, thanks for the background info. I leave this issue open as feature request, but feel free to close if you think it is out of reach ;-)