jaredly / reason-language-server

A language server for reason, in reason
MIT License
659 stars 84 forks source link

Syntax highlighting inconsistent with active theme #233

Open cemerick opened 5 years ago

cemerick commented 5 years ago

I'm using the "Default Dark+" theme, which (for example) renders comments in a plain green style:

screenshot from 2019-01-23 11-37-47

This plugin has all sorts of very idiosyncratic highlighting, including comments in purple italics:

screenshot from 2019-01-23 11-38-37

It looks like the source of this is the ocaml.json file, which was apparently copied over from a different rev of this plugin? (https://github.com/jaredly/reason-language-server/issues/80#issuecomment-412972708)

Anyway, changing this portion:

    "commentBlock": {
      "begin": "\\(\\*(?!\\*[^\\)])",
      "end": "\\*\\)",
      "name": "comment constant.regexp meta.separator.markdown",
      "contentName": "emphasis",
      "patterns": [
        {
          "include": "#commentBlock"
        },
        {
          "include": "#commentDoc"
        }
      ]
    }

…to remove the contentName attribute and trim name to comment yields the expected appearance:

screenshot from 2019-01-23 11-48-09

Can I suggest that this ocaml.json file (and its analogue for reason code) be replaced with ones that yield theme-consistent highlighting?

I'd be willing to take a shot at this, if this seems reasonable.

cemerick commented 5 years ago

To do this right, we'd actually need a sample source file (as short as possible) that demonstrated all possible syntactic constructs. Surely this exists somewhere…