Cross reference Language injected javascript in jetbrains

The current IDE i am using is Rider (ASP.NET Core C#)

How can i resolve these warnings for unidentified javascript functions/classes/members if they are declared in language injected variables?

The same issue occurs in PHPStorm, and I assume it happens in pycharm as well.

public abstract class SelectorScript
{
    public static GlobalDefinition chooseProduct { get; } = new();

    public static ScriptFile File()
    {
        return new ScriptFile(
            /* lang=javascript */
            $$"""
              
                /**
                 * @param {string|Node|$Selector|Window} selector - element or selector
                 * @param {Document|Node} [baseElement] - base element
                 * @returns $Selector
                 */
                $S = (selector, baseElement = document) => {
                    return (new $Selector).$set(selector, baseElement);
                }
          """);
    }
}
    

Code Screenshot
enter image description here

Warning Shown
Warning Shown