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: reader.rs
    path of file: ./repos/fish-shell/src
    
    the code of the file until where you have to start completion: //! Functions for reading data from stdin and passing to the parser. If stdin is a keyboard, it
//! supplies a killring, history, syntax highlighting, tab-completion and various other interactive
//! features.
//!
//! Internally the
    
    fn completion_insert(&mut self, val: &wstr, token_end: usize, flags: CompleteFlags) {
        let (elt, el) = self.active_edit_line();

        // Move the cursor to the end of the token.
        if el.position() != token_end {
            self.update_buff_pos(elt, Some(token_end));
        }

        let (_elt, el) = self.active_edit_line();
        let mut cursor = el.position();
        let new_command_line = completion_apply_to_command_line(
            val,
            flags,
            el.text(),
            &mut cursor,
            /*append_only=*/ false,
        );
        self.set_buffer_maintaining_pager(&new_command_line, cursor, false);
    }