def METHOD_NAME(cursor):
    """Remove all comments from the cursor's selection."""
    source = ly.document.Source(cursor, True, tokens_with_position=True)
    for token in source:
        if isinstance(token, ly.lex.Comment):
            yield token.pos, token.end