镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Highlighting of JSX tags #21

Closed

Description

@jfrolich

Hi,

I'm testing out the new 1.0 release of the plugin and I am very impressed! It might be already on the radar, but I didn't see an issue for it; the JSX tags are currently not highlighted making the source code harder to read IMO. See attached code sample for the difference:

image

Activity

  1. tkovs commented on Nov 26, 2020

    @tkovs

    Here it is working for my own components

    image

  2. jfrolich commented on Nov 26, 2020

    @jfrolich
    ContributorAuthor

    Interesting! That is not working for me. What version of the extension are you using?

  3. tkovs commented on Nov 29, 2020

    @tkovs

    Interesting! That is not working for me. What version of the extension are you using?

    image

  4. jfrolich commented on Nov 30, 2020

    @jfrolich
    ContributorAuthor

    I found out that it is just that my theme didn't color the entity.name.namespace. Many themes do not, because I had this hypothesis that my theme wasn't displaying them and swapped a few themes and they also didn't. Dark+ does however. You can also add the value in the settings:

      "editor.tokenColorCustomizations": {
        "textMateRules": [
          {
            "name": "JSX",
            "scope": ["entity.name.namespace"],
            "settings": {
              "foreground": "#80CBC4"
            }
          },
          // you might also want to set this for polymorphic variants
          {
            "name": "other",
            "scope": ["punctuation.definition.keyword"],
            "settings": {
              "foreground": "#f87086"
            }
          }
        ]
      }
  5. Faliszek commented on Dec 8, 2020

    @Faliszek

    @jfrolich thanks for the solution, i also wanted to highlight in my theme jsx element and their attributes but I found out, that with actual grammar this it is not possible yet(?).
    What i mean is, in .re file with ocaml-platform extension when i check it with Cmd + Shift + P and pick DM: Inspect editor tokens and scopes i get something like this when checking

      Zrzut ekranu 2020-12-8 o 01 29 13 Zrzut ekranu 2020-12-8 o 01 29 18

      but right now they are not assigned to any scope

      Zrzut ekranu 2020-12-8 o 01 29 49

      Is it bug... or it is something that won't be implemented?

      PS. I was thinking about it creating new issue, but this is also related to jsx so i thought it might good place to point that out because i think lot's of themes are decorating jsx in this manner

  6. Faliszek commented on Dec 10, 2020

    @Faliszek

    Hm, i can see that there is already pull request open with adding this feature

    #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions