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

Revisit ranges pointed to by SymbolDef::find #129

Closed
mkaput opened this issue Dec 20, 2024 · 0 comments · Fixed by #257
Closed

Revisit ranges pointed to by SymbolDef::find #129

mkaput opened this issue Dec 20, 2024 · 0 comments · Fixed by #257
Assignees
Milestone

Comments

@mkaput
Copy link
Member

mkaput commented Dec 20, 2024

We should introduce a separation of full range vs focus range like RA has and revisit spans that we produce for goto definition & references etc.

For example, instead of going from this:

        fn boun<caret>dary(self: Rectangle) -> u64 {

to this:

    <sel>impl RectangleGeometry of ShapeGeometry<Rectangle> {
        fn boundary(self: Rectangle) -> u64 {
            2 * (self.height + self.width)
        }
        fn area(self: Rectangle) -> u64 {
            self.height * self.width
        }
    }</sel>

we should go to:

    impl RectangleGeometry of ShapeGeometry<Rectangle> {
        fn <sel>boundary</sel>(self: Rectangle) -> u64 {
            2 * (self.height + self.width)
        }
        fn area(self: Rectangle) -> u64 {
            self.height * self.width
        }
    }

this issue applies to almost all other kinds of "definitable" elements.

@mkaput mkaput moved this to Triage in Cairo Language Services Dec 20, 2024
@Arcticae Arcticae added the bug label Jan 8, 2025
@Arcticae Arcticae moved this from Triage to Backlog in Cairo Language Services Jan 8, 2025
@mkaput mkaput added this to the Goto milestone Jan 13, 2025
@mkaput mkaput moved this from Backlog to In Progress in Cairo Language Services Jan 13, 2025
@mkaput mkaput self-assigned this Jan 13, 2025
mkaput added a commit that referenced this issue Jan 31, 2025
cc #164 - great progress towards closing this
cc #129

commit-id:919fc6f0
mkaput added a commit that referenced this issue Feb 3, 2025
cc #164 - great progress towards closing this
cc #129

commit-id:919fc6f0
mkaput added a commit that referenced this issue Feb 5, 2025
…enum variants

Previously, `SymbolDef::Item` was used for enum variants. `ItemDef::name` returned the name of a **lookup item** related to the item, which for enum variants was **the enum**, not the variant itself. This caused a bug because usage finding uses the symbol's name as a text search needle, which made the algorithm attempt looking for references to the enum, yielding effectively no usage results.

fix #129 - this was the last FIXME comment related to that issue that was left, even though the bug eventually appeared to be completely unrelated.

commit-id:374fbe2d
@github-project-automation github-project-automation bot moved this from In Progress to Done in Cairo Language Services Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
2 participants