textmate / yaml.tmbundle

TextMate support for YAML
17 stars 17 forks source link

First characters seem to be their own tokens #44

Open martpie opened 1 year ago

martpie commented 1 year ago

Please pardon my ignorance, I'm very new to Textmate grammars.

I am working on a VS Code extension to highlight certains keys in YAML file to improve the DevX when dealing with Hydra config files (that are pure YAMLs).

While trying to select some keys, I realized the first character of each token seem to be its own token?

Example with:

array:
  - _target_: what
Screenshot 2023-10-03 at 14 17 39 Screenshot 2023-10-03 at 14 17 35 Screenshot 2023-10-03 at 14 17 44 Screenshot 2023-10-03 at 14 17 48

Notice how _ and target_ are different tokens, and how w and hat are different tokens. In this case, that make it quite hard to select _target_ as a key to apply to it a custom style.

Is that intentional? Is that some obscure part of the YAML spec I am not aware about?

martpie commented 9 months ago

Poke :)

Cthuflu commented 7 months ago

Cross referencing that this had been submitted directly for vscode as well: https://github.com/microsoft/vscode/issues/180523