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

Update homeAssistant matcher #21

Open CeeWeasel opened 3 years ago

CeeWeasel commented 3 years ago

Home Assistant has MDI icons baked into it, but use a prefix of hass. They are referenced in yaml files like this:

great_room_motion:
  icon: hass:walk
  name: Great Room Motion
  entities:
    - binary_sensor.great_room_motion

Changing the homeAssistant matcher as below ensures that the icons are found and inserted properly.

        {
            "match": "\\bhass:{param}\\b",
            "insert": "hass:{param}",
            "displayName": "Home Assistant",
            "name": "homeAssistant"
        }

Users can still use the kebabCase to match icons referenced as icon: mdi:walk, but updating the homeAssistant matcher will also catch users that leverage Home Assistant's baked in icons.

lukas-tr commented 3 years ago

According to https://www.home-assistant.io/docs/configuration/customizing-devices/#icon the official prefix is mdi:.

And there's also this conversation https://gist.github.com/thomasloven/01e03543364cf685eff969ad7980f5d7#gistcomment-3596355:

hass: is for internal use. Users shall use mdi:

So I'm not sure if I should add it.