-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YAML syntax highlight is wrong on keys that happen to be keywords #34
Comments
That is not really a bug, as far as I can tell. The word |
But that’s only when the keyword is used in a value position, to the right of the |
The text from yaml import safe_load
print(safe_load('on: on'))
print(safe_load("'on': 'on'"))
print(safe_load('on: !!str on')) prints the following text on my machine:
I can totally understand that you were surprised that |
Thanks for the explanation. You can close the issue if you want (I can’t because the issue wasn’t created by me.) It seems that different libraries don’t agree on what YAML means: JavaScript > require("js-yaml").load("on: on")
{ on: 'on' }
> require("yaml").parse("on: on")
{ on: 'on' } Ruby > require "yaml"
> YAML.load("on: on")
=> {true=>true} In any case, from a syntax highlighter’s perspective, it makes more sense to do what |
Interesting. It seems YAML spec itself (at least the grammar) doesn't strictly define what is to be interpreted as Well, if it was up to me I would at least distinguish true|false from the rest, so that themes|users could decide what applies. E.g: |
From @leafac in microsoft/vscode#94738
Issue Type: Bug
The keys are highlighted as keywords, for example, consider the keyword
on
:(For example, you may see the
on
keyword as a key in the configuration for a GitHub Action.)VS Code version: Code 1.44.0 (2aae1f26c72891c399f860409176fe435a154b13, 2020-04-08T08:23:56.137Z)
OS version: Darwin x64 19.4.0
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Extensions (5)
The text was updated successfully, but these errors were encountered: