-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Should have better IDE support #2214
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
Comments
Thanks for the report! I'm happy to review PRs and/or discuss possible ways to solve this, but unfortunately I don't have time to work on this myself. That PR is beneficial enough that I do not think it's worth reverting, additionally. |
Do I understand correctly that previously all wasm-bindgen work was done in during |
@vlad20012 no, this was true only for |
@vlad20012 now, when you're here, I thought about this some more and I think it shouldn't be that complicated to support it in the plugin, if you're willing to special case it, because Basically this is the failing structure: #[wasm_bindgen]
extern "C" {
type SomeJsType;
#[wasm_bindgen]
fn method(this: &SomeJsType);
} Plugin sees this as a function and unrelated type but it should interpret it as: struct SomeJsType;
impl SomeJsType {
fn method(&self){}
} This would make the resolution correct. |
Oh, let's just support proc macros |
Well.. if you think that's simpler solution 😄 😄 |
Closing since the latest IntelliJ update fixed the situation for me. Feel free to reopen if someone has stronger opinions about IDE support. |
Motivation
I have the same problem as @panstromek in this PR. With the changes that landed there code completion in IntelliJ broke; and in turn yew + web-sys became unusable for me.
One could argue this is an IDE issue and having them fix the problem would be nice, but for example the underlying IntelliJ ticket has been around for 3 years, so it's unlikely to happen soon.
For most other libs I'd just switch to something with autocomplete support, but
web-sys
has a quasi monopoly on client-web interop, so one could also argue there is some shared responsibility.Possible Solution?
Microsoft's win-rt uses
build.rs
+ proc macros to create awinrt.rs
, as described here, which can be included viainclude!(concat!(env!("OUT_DIR"), "/winrt.rs"));
. This works really well for me. I am wondering if something similar is possible here?The text was updated successfully, but these errors were encountered: