Skip to content

Parameter inlay hint offsetting the argument names #2874

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
bjorn3 opened this issue Jan 18, 2020 · 10 comments
Closed

Parameter inlay hint offsetting the argument names #2874

bjorn3 opened this issue Jan 18, 2020 · 10 comments

Comments

@bjorn3
Copy link
Member

bjorn3 commented Jan 18, 2020

image

@bjorn3
Copy link
Member Author

bjorn3 commented Jan 18, 2020

The variable module is not defined, but I would expect it either not give parameter inlay hints, or show the correct names based on the only function called declare_data.

@lnicola
Copy link
Member

lnicola commented Jan 18, 2020

Also, the linkage hint is on the wrong argument.

@bjorn3
Copy link
Member Author

bjorn3 commented Jan 18, 2020

Yes, also writable is the first bool and tls is the second bool. I also notice now that id should be called name, so I guess there is another function which is also called declare_data.

@flodiebold
Copy link
Member

What does 'go to definition' on the method call go to?

@bjorn3
Copy link
Member Author

bjorn3 commented Jan 18, 2020

It goes to https://docs.rs/cranelift-module/0.56.0/cranelift_module/trait.Backend.html#tymethod.declare_data instead of the https://docs.rs/cranelift-module/0.56.0/cranelift_module/struct.Module.html#method.declare_data I meant. The former does indeed have id has first param, but that method has one more param than the later (it has one too much for this call)

@flodiebold
Copy link
Member

Method resolution doesn't look at the parameters (except self)... I'm wondering why it got the idea that module implements this trait though -- is there any kind of blanket impl for it?

@bjorn3
Copy link
Member Author

bjorn3 commented Jan 18, 2020

I don't think there is any blanket impl for Backend.

@to-mas-kral
Copy link
Contributor

to-mas-kral commented Jan 21, 2020

Also, is there a reason why there are no hints for non-literals ?

@SomeoneToIgnore
Copy link
Contributor

Also, is there a reason why there are no hints for non-literals ?

This is the reason, I believe: #1618

@bjorn3
Copy link
Member Author

bjorn3 commented Dec 19, 2020

I haven't seen this problem in a long time.

@bjorn3 bjorn3 closed this as completed Dec 19, 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

5 participants