mattbierner / vscode-emojisense

Emoji Autocomplete Plugin For VSCode
https://marketplace.visualstudio.com/items?itemName=bierner.emojisense
MIT License
119 stars 9 forks source link

Allow for searching by tag, description #47

Open eschwartz opened 2 years ago

eschwartz commented 2 years ago

Allow searching by tag or description, in addition to the actual emoji name.

For example, we can search by the :rich: tag to get 🤑 , by the :flirt: tag to get either 😉 or 😘 , or the :downcast description to get 😓

To support this, our emojiMap needs to support multiple matching emojis for each lookup term. I also updated the completion provider to show the search term to the right of the actual emoji name.


BTW, I love this extension thanks @mattbierner for sharing all your hard work on this! I teach at a programming bootcamp, and it adds some needed fun to remote lectures 😄

Demo 2021-10-07 10 29 31

Gemoji Data For the demo's emojis


  {
    "emoji": "🤑",
    "names": [
      "money_mouth_face"
    ],
    "tags": [
      "rich"
    ],
    "description": "money-mouth face",
    "category": "Smileys & Emotion"
  },
  {
    "emoji": "😘",
    "names": [
      "kissing_heart"
    ],
    "tags": [
      "flirt"
    ],
    "description": "face blowing a kiss",
    "category": "Smileys & Emotion"
  },
  {
    "emoji": "😉",
    "names": [
      "wink"
    ],
    "tags": [
      "flirt"
    ],
    "description": "winking face",
    "category": "Smileys & Emotion"
  },
  {
    "emoji": "😓",
    "names": [
      "sweat"
    ],
    "tags": [],
    "description": "downcast face with sweat",
    "category": "Smileys & Emotion"
  },
eschwartz commented 2 years ago

Thanks for taking a look. I will give it another go, and see if I can fix up those issues.

eschwartz commented 2 years ago

@mattbierner Took a bit of research and poking around, but I think I have a better approach here.

The key is the CompletionItem.filterText property, which is what VSCode uses to filter the list of results. So rather than update the emojiMap to include duplicate emojis for each tag, I'm just including those tags as strings in the filterText. This prevents the duplicate suggestions.

I also updated the Markdown preview to show the category, tags, and description. And I verified that it works with ::.

Demo with : 2021-10-11 11 53 26

Demo with :: 2021-10-11 11 54 45

Cussa commented 3 months ago

@eschwartz @mattbierner hello! Is there any update on this? I believe that this is an amazing feature and would be amazingly helpful to have it.

If @eschwartz is not interested anymore in doing that, I can try to continue from where he stopped.

Please, let me know!