Skip to content

Methods' parameters snippet includes self #3466

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

Closed
Avishayy opened this issue Mar 4, 2020 · 1 comment
Closed

Methods' parameters snippet includes self #3466

Avishayy opened this issue Mar 4, 2020 · 1 comment

Comments

@Avishayy
Copy link
Contributor

Avishayy commented Mar 4, 2020

#3432 introduced snippet support for functions parameters, however - it includes the self parameter when it shouldn't, e.g.

impl Rectangle {
    fn translate(&mut self, x: f64, y: f64) { ... }
}

fn main() {
    let mut rectangle = Rectangle { ... };
    rectangle.translate| // press completion hotkey
}

Picking the completion will expand to (&mut self, x, y) when the expected behaviour is (x, y)

One more interesting thing is that requesting completions with Rectangle:: will produce no results as module functions with the self parameter will not receive completions.

I will take care of the first issue but I don't understand the rationale in the second one, is there supposed to be something else there or was it just not implemented yet?

@Avishayy
Copy link
Contributor Author

Avishayy commented Mar 4, 2020

Nevermind, seems like this was fixed in #3442 and I found out when I tried to rebase on master and had conflicts :)

Screenshot from 2020-03-04 23-28-20

@Avishayy Avishayy closed this as completed Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant