lukas-tr / vscode-materialdesignicons-intellisense

Provides intellisense, search and hover preview for Material Design Icons
https://marketplace.visualstudio.com/items?itemName=lukas-tr.materialdesignicons-intellisense
MIT License
35 stars 7 forks source link

Trying to make a custom matcher for React Native Vector Icon #17

Closed kuasha420 closed 3 years ago

kuasha420 commented 4 years ago

Hello

I'm truing to match the following format but so far having partial success with it.

<Icon name="{param}"

and

icon="{param}"

{
      "match": "\\bname\\=\"{param}\"\\b",
      "insert": "{param}",
      "displayName": "React Native Vector Icon",
      "name": "rnvec"
    },
    {
      "match": "\\bicon\\=\"{param}\"\\b",
      "insert": "{param}",
      "displayName": "React Native Icon Props",
      "name": "rnicon"
    }

I can get the intelisense but the little preview icon in the left side is not working.

Help would be greatly appreciated!

lukas-tr commented 3 years ago

Is just the preview on the left not working or does the hover preview also not show up?

kuasha420 commented 3 years ago

@lukas-tr The hover preview also doesn't show up. Only intelisense works

lukas-tr commented 3 years ago

\b matches word boundaries (a \w followed/preceded by a \W character). Remove the \b at the end and your're good.

        {
            "match": "\\bname\\=\"{param}\"",
            "insert": "{param}",
            "displayName": "React Native Vector Icon",
            "name": "rnvec"
        },
        {
            "match": "\\bicon\\=\"{param}\"",
            "insert": "{param}",
            "displayName": "React Native Icon Props",
            "name": "rnicon"
        }
kuasha420 commented 3 years ago

@lukas-tr Thanks a bunch!