//! > Test adding simple trait.

//! > test_runner_name
test_completions_text_edits

//! > cairo_project.toml
[crate_roots]
hello = "src"

[config.global]
edition = "2024_07"

//! > cairo_code
mod hidden_trait {
    pub trait ATrait1<T> {
        fn some_method(self: @T);
    }
    impl Felt252ATraitImpl of ATrait1<felt252> {
        fn some_method(self: @felt252) {}
    }
}

use hidden_trait::ATrait1;

mod inner_mod {
    fn main() {
        let x = 5_felt252;
        x.some_me<caret>
    }
}

//! > Completions #0
        x.some_me<caret>
--------------------------
Completion: add_eq()
Insert text: add_eq($0)
Text edit: use core::traits::AddEq;
--------------------------
Completion: sub_eq()
Insert text: sub_eq($0)
Text edit: use core::traits::SubEq;
--------------------------
Completion: mul_eq()
Insert text: mul_eq($0)
Text edit: use core::traits::MulEq;
--------------------------
Completion: into()
Insert text: into($0)
--------------------------
Completion: try_into()
Insert text: try_into($0)
--------------------------
Completion: destruct()
Insert text: destruct($0)
--------------------------
Completion: panic_destruct()
Insert text: panic_destruct($0)
--------------------------
Completion: new_inputs()
Insert text: new_inputs($0)
Text edit: use core::circuit::CircuitInputs;
--------------------------
Completion: get_descriptor()
Insert text: get_descriptor($0)
--------------------------
Completion: clone()
Insert text: clone($0)
--------------------------
Completion: is_zero()
Insert text: is_zero($0)
Text edit: use core::num::traits::Zero;
--------------------------
Completion: is_non_zero()
Insert text: is_non_zero($0)
Text edit: use core::num::traits::Zero;
--------------------------
Completion: is_one()
Insert text: is_one($0)
Text edit: use core::num::traits::One;
--------------------------
Completion: is_non_one()
Insert text: is_non_one($0)
Text edit: use core::num::traits::One;
--------------------------
Completion: add_assign()
Insert text: add_assign($0)
Text edit: use core::ops::AddAssign;
--------------------------
Completion: sub_assign()
Insert text: sub_assign($0)
Text edit: use core::ops::SubAssign;
--------------------------
Completion: mul_assign()
Insert text: mul_assign($0)
Text edit: use core::ops::MulAssign;
--------------------------
Completion: serialize()
Insert text: serialize($0)
--------------------------
Completion: print()
Insert text: print($0)
--------------------------
Completion: fmt()
Insert text: fmt($0)
Text edit: use core::fmt::Display;
--------------------------
Completion: fmt()
Insert text: fmt($0)
Text edit: use core::fmt::Debug;
--------------------------
Completion: fmt()
Insert text: fmt($0)
Text edit: use core::fmt::LowerHex;
--------------------------
Completion: is_zero()
Insert text: is_zero($0)
--------------------------
Completion: is_non_zero()
Insert text: is_non_zero($0)
--------------------------
Completion: append_formatted_to_byte_array()
Insert text: append_formatted_to_byte_array($0)
Text edit: use core::to_byte_array::AppendFormattedToByteArray;
--------------------------
Completion: format_as_byte_array()
Insert text: format_as_byte_array($0)
Text edit: use core::to_byte_array::FormatAsByteArray;
--------------------------
Completion: some_method()
Insert text: some_method($0)
Text edit: use super::ATrait1;

//! > ==========================================================================

//! > Test adding non directly visible traits.

//! > test_runner_name
test_completions_text_edits

//! > cairo_project.toml
[crate_roots]
hello = "src"

[config.global]
edition = "2024_07"

//! > cairo_code
mod hidden_trait {

    pub trait ATrait1<T> {
        fn some_method(self: @T);
    }
    impl Felt252ATraitImpl of ATrait1<felt252> {
        fn some_method(self: @felt252) {}
    }
}

use hidden_trait::ATrait1;

mod inner_mod {
    fn main() {
        let x = 5_felt252;
        x.some_me<caret>
    }
}

//! > Completions #0
        x.some_me<caret>
--------------------------
Completion: add_eq()
Insert text: add_eq($0)
Text edit: use core::traits::AddEq;
--------------------------
Completion: sub_eq()
Insert text: sub_eq($0)
Text edit: use core::traits::SubEq;
--------------------------
Completion: mul_eq()
Insert text: mul_eq($0)
Text edit: use core::traits::MulEq;
--------------------------
Completion: into()
Insert text: into($0)
--------------------------
Completion: try_into()
Insert text: try_into($0)
--------------------------
Completion: destruct()
Insert text: destruct($0)
--------------------------
Completion: panic_destruct()
Insert text: panic_destruct($0)
--------------------------
Completion: new_inputs()
Insert text: new_inputs($0)
Text edit: use core::circuit::CircuitInputs;
--------------------------
Completion: get_descriptor()
Insert text: get_descriptor($0)
--------------------------
Completion: clone()
Insert text: clone($0)
--------------------------
Completion: is_zero()
Insert text: is_zero($0)
Text edit: use core::num::traits::Zero;
--------------------------
Completion: is_non_zero()
Insert text: is_non_zero($0)
Text edit: use core::num::traits::Zero;
--------------------------
Completion: is_one()
Insert text: is_one($0)
Text edit: use core::num::traits::One;
--------------------------
Completion: is_non_one()
Insert text: is_non_one($0)
Text edit: use core::num::traits::One;
--------------------------
Completion: add_assign()
Insert text: add_assign($0)
Text edit: use core::ops::AddAssign;
--------------------------
Completion: sub_assign()
Insert text: sub_assign($0)
Text edit: use core::ops::SubAssign;
--------------------------
Completion: mul_assign()
Insert text: mul_assign($0)
Text edit: use core::ops::MulAssign;
--------------------------
Completion: serialize()
Insert text: serialize($0)
--------------------------
Completion: print()
Insert text: print($0)
--------------------------
Completion: fmt()
Insert text: fmt($0)
Text edit: use core::fmt::Display;
--------------------------
Completion: fmt()
Insert text: fmt($0)
Text edit: use core::fmt::Debug;
--------------------------
Completion: fmt()
Insert text: fmt($0)
Text edit: use core::fmt::LowerHex;
--------------------------
Completion: is_zero()
Insert text: is_zero($0)
--------------------------
Completion: is_non_zero()
Insert text: is_non_zero($0)
--------------------------
Completion: append_formatted_to_byte_array()
Insert text: append_formatted_to_byte_array($0)
Text edit: use core::to_byte_array::AppendFormattedToByteArray;
--------------------------
Completion: format_as_byte_array()
Insert text: format_as_byte_array($0)
Text edit: use core::to_byte_array::FormatAsByteArray;
--------------------------
Completion: some_method()
Insert text: some_method($0)
Text edit: use super::ATrait1;
