Skip to content

Expanding Code Action Sample Diagnostic File #65

Discussion options

You must be logged in to vote

Hi @VaniSachdev ,

That samples handles the EMOJI constant in places. At first, in refreshDiagnostics, looking of its presence in the current line. After that in createDiagnostic to find out it location.

If you want multiple words, you could simply create an EMOJIS array and update refreshDiagnostics to something like this:

if (EMOJIS.some(item => lineOfText.text.includes(item))) {

It will kind of work, but it has the same flaw as the original sample itself, because it is not looking for a word that matches the emoji, but a piece of text. For instance, if you type memojior emoji in the original sample, both will be recognized, but memoji shouldn't, right?

I see two alternatives.

  • Using reg…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@VaniSachdev
Comment options

@alefragnani
Comment options

@VaniSachdev
Comment options

@alefragnani
Comment options

Answer selected by isidorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants