IN3D / vim-raml

Vim syntax and language settings for RAML (Now a part of Vim 8 & NeoVim!)
33 stars 0 forks source link

Colon Inside String #1

Closed benhamill closed 8 years ago

benhamill commented 8 years ago

In have this snippet in a RAML file:

types:
  # ...
  VenueHours:
    type: string[]
    examples:
      - content: ["08:00", "17:30"]
      - content: ["09:00", "20:00"]

Everything after the first : in the next-to-last line (the middle of "08:00") is cyan (in case that's highly dependent on color scheme, its the same color as any quoted string. Seems the colon and quotes is confusing the highlighting?

Similarly, above that, I have this:

types:
  # ...
  Region:
    properties:
      # ...
      utc_offset:
        type: string
        examples:
          - content: +03:30
          - content: -06:00

In those two examples, the +03 and -06 are blue like a key (same color as content or type), the : is red (same as the : after content or type) and the 30 and 00 are light blue like a quoted string.

These problems don't show up if I manually :set ft=yaml.

Let me know if there's anything else I can provide to help debug this.

benhamill commented 8 years ago

Here's a minimal document to display the weirdness:

#%RAML 1.0
types:
  Foo:
    properties:
      bar:
        type: string
        example: +03:00
      baz:
        type: string[]
        example: ["08:00", "17:30"]
  ThisStuffShouldn'tBeLightBlue:
    properties:
      right?: right
IN3D commented 8 years ago

Thanks for finding this one. This is for sure a bug. The examples are a big help, that's more a great amount of information to go on.

IN3D commented 8 years ago

I was able to recreate your problem locally, and the change that I pushed fixed both of your issues for me. If you are still having any problems, please let me know, and I'll re-open the issue!

benhamill commented 8 years ago

Well, holy crap. That was a fast turn-around time. Thanks so much! This seems to have cleared up the issue that was breaking highlighting for the whole file (the "08:00" part). I'm still seeing funky coloring of times in the +03:00 case, though. And I've noticed a few other weird places where I'd expect the highlighter to be treating stuff as a string, but it's highlighting the word "string" and such.

None of it is breaking, but it makes reading descriptions and such kind of an eye-popping experience. Do you want me to work up another example file that shows off more of that kind of thing? If so, do you want it in a new Issue or this one?

Again, thanks for your time. :sparkling_heart:

IN3D commented 8 years ago

Not a problem, happy to fix it.

And if you would be willing to that would be great. Some of the things you're describing sound like what I'd classify as an enhancement (without seeing it anyway), so if you would make a separate issue for them I'd appreciate that.