yuezk / vim-js

💯The most accurate syntax highlighting plugin for JavaScript and Flow.js
MIT License
140 stars 8 forks source link

Syntax color problem for a comment inside a complex Flow type #14

Closed julienw closed 3 years ago

julienw commented 3 years ago

I've just seen a similar problem to #13, but this time with ' inside a comment, and the comment itself inside some complex Flow typing:

export type GeckoSamples = {|
  schema:
    | {|
        stack: 0,
        time: 1,
        responsiveness: 2,
      |}
    | {|
        stack: 0,
        time: 1,
        eventDelay: 2,
      |},
  data: Array<
    [
      null | IndexIntoGeckoStackTable,
      Milliseconds, // since profile.meta.startTime
      // milliseconds since the last event was processed in this
      // thread's event loop at the time that the sample was taken
      Milliseconds
    ]
  >,
|};

Gives Screenshot I think the comment itself isn't found as a comment, and that's the real source of the problem here; and this is arguably a complex piece of syntax here :-)

julienw commented 3 years ago

After this error, all the syntax in the rest of the file is broken, because the type generic is never closed.

The full file is at https://github.com/firefox-devtools/profiler/blob/ada7782f25ba67c72d5fdd525d2430ab6118f2df/src/types/gecko-profile.js if you're curious.

yuezk commented 3 years ago

@julienw Both #13 and #14 should have been fixed now. Please verify it.