Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix goto and rename on impl associated items #405

Open
mkaput opened this issue Mar 4, 2025 · 0 comments
Open

Fix goto and rename on impl associated items #405

mkaput opened this issue Mar 4, 2025 · 0 comments
Milestone

Comments

@mkaput
Copy link
Member

mkaput commented Mar 4, 2025

// FIXME: https://github.com/software-mansion/cairols/issues/405
#[test]
fn associated_const_via_expr_use() {
test_transform!(goto_definition, r#"
trait Shape<T> { const SIDES: u32; }
struct Triangle {}
impl TriangleShape of Shape<Triangle> { const SIDES: u32 = 3; }
fn print_shape_info<T, impl ShapeImpl: Shape<T>>() {
let _ = ShapeImpl::SIDE<caret>S;
}
"#, @"none response");
}

// FIXME: https://github.com/software-mansion/cairols/issues/405
#[test]
fn associated_const_via_expr_use() {
test_transform!(test_hover, r#"
trait Shape<T> { const SIDES: u32; }
struct Triangle {}
impl TriangleShape of Shape<Triangle> { const SIDES: u32 = 3; }
fn print_shape_info<T, impl ShapeImpl: Shape<T>>() {
let _ = ShapeImpl::SIDE<caret>S;
}
"#, @r#"
source_context = """
let _ = ShapeImpl::SIDE<caret>S;
"""
popover = """
```cairo
core::integer::u32
```
"""
"#);
}

// FIXME: https://github.com/software-mansion/cairols/issues/405
#[test]
fn associated_const_via_expr_use() {
test_transform!(find_references, r#"
trait Shape<T> { const SIDES: u32; }
struct Triangle {}
impl TriangleShape of Shape<Triangle> { const SIDES: u32 = 3; }
fn print_shape_info<T, impl ShapeImpl: Shape<T>>() {
let _ = ShapeImpl::SIDE<caret>S;
}
"#, @"none response");
}

// FIXME: https://github.com/software-mansion/cairols/issues/405
#[test]
fn associated_const_via_expr_use() {
test_transform!(rename, r#"
trait Shape<T> { const SIDES: u32; }
struct Triangle {}
impl TriangleShape of Shape<Triangle> { const SIDES: u32 = 3; }
fn print_shape_info<T, impl ShapeImpl: Shape<T>>() {
let _ = ShapeImpl::SIDE<caret>S;
}
"#, @"none response");
}

@mkaput mkaput moved this to Triage in Cairo Language Services Mar 4, 2025
@mkaput mkaput added this to the Goto milestone Mar 4, 2025
@mkaput mkaput moved this from Triage to Backlog LS in Cairo Language Services Mar 4, 2025
@piotmag769 piotmag769 changed the title Fix goto on impl associated items Fix goto and rename on impl associated items Mar 6, 2025
@mkaput mkaput self-assigned this Mar 10, 2025
@mkaput mkaput moved this from Backlog LS to In Progress in Cairo Language Services Mar 10, 2025
@mkaput mkaput removed their assignment Mar 10, 2025
@mkaput mkaput moved this from In Progress to Backlog LS in Cairo Language Services Mar 10, 2025
mkaput added a commit that referenced this issue Mar 11, 2025
cc #170
cc #405
fix #440
fix #449
@mkaput mkaput mentioned this issue Mar 11, 2025
@mkaput mkaput self-assigned this Mar 17, 2025
@mkaput mkaput moved this from Backlog LS to In Progress in Cairo Language Services Mar 17, 2025
@mkaput mkaput moved this from In Progress to Backlog LS in Cairo Language Services Mar 17, 2025
@mkaput mkaput removed their assignment Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog LS
Development

No branches or pull requests

1 participant