You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: highlight.rs
    path of file: ./repos/biome/crates/biome_js_parser/src/lexer
    
    the code of the file until where you have to start completion: use crate::*;
use std::io::{stderr, stdout, IsTerminal};

pub use ansi_term::{self, ANSIGenericString, Color, Style};

/// A structure for syntax highlighting pieces of JavaScript source code
/// using ANSI.
///
/// The highlighter will auto detect if stderr or stdout are terminals, if
/// they are not then it will return the original uncolored source code.
/// All errors encountered while lexing are ignored.
///
/// The highlighter is iterator based, which allows for coloring a part of code
/// at a time.
/// The highlighter's position can be controlled through various methods which allows
/// for reuse of the highlighter without the need to rescan the source code
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Highlighter<'s> {
    pub source: &'s str,
    tokens: Vec<Token>,
    /// Current token position
    cur: usize,
    /// Current byte index in source
    cur_idx: usize,
}

macro_rules! rgb {
    ($r:expr, $g:expr, $b:expr) => {
        Color::RGB($r, $g, $b)
    };
}

impl<'s> Highlighter<'s> {
    /// Make a new highlighter, this will invoke the lexer to get tokens.
    pub fn new(source: &'s str) -> Highlighter<'s> {
        let tokens = Lexer::from_str(source, 0).map(|t| t.0).collect();

        Self {
            so
    
    fn next(&mut self) -> Option<Self::Item> {
        if self.tokens.get(self.cur) == None {
            return None;
        }

        let color = match self.tokens.get(self.cur)?.kind {
            T!['{'] | T!['}'] | T!['('] | T![')'] => rgb![255, 215, 0],
            T![import] => rgb![97, 175, 239],
            T![ident] if PURPLE_IDENT.contains(&self.src()) => rgb![198, 120, 221],
            T![ident] if self.src() == "from" => rgb![97, 175, 239],
            T![ident] if BUILTINS.contains(&self.src()) => rgb![229, 192, 123],
            T![ident] => rgb![224, 108, 117],
            T![instanceof] | T![new] | T![?] | T![delete] | T![:] | T![const] => {
                rgb![198, 120, 221]
            }
            t if t.is_punct() => rgb![86, 182, 194],
            t if t.is_keyword() => rgb![198, 120, 221],
            JsSyntaxKind::JS_STRING_LITERAL
            | JsSyntaxKind::BACKTICK
            | JsSyntaxKind::TEMPLATE_CHUNK => {
                rgb![152, 195, 121]
            }
            JsSyntaxKind::JS_NUMBER_LITERAL => rgb![209, 154, 102],
            JsSyntaxKind::DOLLAR_CURLY => rgb![198, 120, 221],
            JsSyntaxKind::ERROR_TOKEN => rgb![244, 71, 71],
            JsSyntaxKind::COMMENT => rgb![127, 132, 142],
            _ => Color::White,
        };

        let string = self.src();
        let token_len: usize = self.tokens.get(self.cur).unwrap().len().into();
        self.cur_idx += token_len;
        self.cur += 1;
        Some(color.paint(string))
    }