Adding icons before selections in Codemirror 6

I’m building a feature where I would like to inject icons before certain chunks of code. I have an array of strings that match code in the document, and I would like to iterate through that and place an icon before each match.

I thought I had the right idea on how to accomplish this, but it didn’t work. What I did was iterate through my array and use the SearchCursor to get the locations, and then use a RangeSet builder to place the decorations.

I can see the widget HTML in the inspector, but they seem to cause overflow issues and they don’t display, I’m using a ::before pseudo element and a background image to display the icon image.

My question is, am I on the right track, or is there a better way to inject icons before matches in CM6?

In previous versions, I used text markers to apply a class to a certain text selection and used the same ::before pseudo-element, and it worked perfectly.

Edit: I also tried using a decoration mark instead of a widget and it’s still not displaying.

Disregard, I got it working!