# EmojiProvider
Class Inherits GraffitiProEditor.Suggestions.Provider
## About
`Suggestions.EmojiProvider` inserts emoji by shortcode: typing a colon and part of a name, such as `:thu`, lists matching emoji, such as 👍 :thumbsup:, and choosing one with Return, Tab, or a click replaces the shortcode with the emoji. Each `Editor` adds one to `SuggestionProviders` when it is constructed, with the identifier "emoji"; remove it to turn the picker off.
```xojo
Editor.SuggestionProviders.Remove("emoji")
```
The popup opens only for a colon that starts a word, after at least two shortcode characters, so times such as 10:30 and labels such as "Note:" are typed as usual. Shortcodes are the common GitHub and Slack names, such as `smile`, `tada`, `+1`, and `white_check_mark`; shortcodes that start with the query come first, then shortcodes with a search keyword that does, such as `:lol` or `:haha` for 😂 and `:yes` for 👍, then shortcodes that contain the query anywhere.
Unlike other providers, the chosen emoji is ordinary text in the current style, not a tag, so it exports as the character itself. Subclass it and override `Suggestions` to offer a different set of emoji.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| CommitSuggestion | content As GraffitiProEditor.EditableContent <br> request As GraffitiProEditor.Suggestions.Request <br> suggestion As GraffitiProEditor.Suggestions.Suggestion <br> currentStyle As GraffitiProEditor.TextStyle | Integer | Replaces the typed shortcode with the chosen emoji as ordinary text in the current style, and returns the new caret position. |
| Constructor | (None) | (None) | Creates the emoji provider, with the identifier "emoji" and the trigger ":". |
| Match | textBeforeCaret As String <br> caretPosition As Integer <br> content As GraffitiProEditor.Suggestions.Content | GraffitiProEditor.Suggestions.Request | Returns a request when the text before the caret is a colon that starts a word, followed by at least two shortcode characters. |
| Suggestions | request As GraffitiProEditor.Suggestions.Request <br> maximumResults As Integer = 6 | GraffitiProEditor.Suggestions.Suggestion | Returns the emoji whose shortcodes start with the query, then those with a keyword that starts with it, then those whose shortcodes contain it. |