def get_highlight_arrows_for_line(
        self,
        line: str,
        raw_line: str,
        lineno: int | None,
        end_lineno: int | None,
        colno: int | None,
        end_colno: int | None,
    ) -> list[str]:
        """Return characters highlighting a source line.

        Example with colno and end_colno pointing to the bar expression:
                   "foo() + bar()"
        returns    "        ^^^^^"
        """
        if lineno != end_lineno:
            # Don't handle expressions that span multiple lines.
            return []
        if colno is None or end_colno is None:
            # Can't do anything without column information.
            return []

        num_stripped_chars = len(raw_line) - len(line)

        start_char_offset = _byte_offset_to_character_offset(raw_line, colno)
        end_char_offset = _byte_offset_to_character_offset(raw_line, end_colno)
        num_carets = end_char_offset - start_char_offset
        # If the highlight would span the whole line, it is redundant, don't
        # show it.
        if num_carets >= len(line.strip()):
            return []

        highlights = "    "
        highlights += " " * (start_char_offset - num_stripped_chars + 1)
        highlights += "^" * num_carets
        return [highlights]
Return characters highlighting a source line.

        Example with colno and end_colno pointing to the bar expression:
                   "foo() + bar()"
        returns    "        ^^^^^"
        
src/_pytest/_code/code.py