rls autocompletion not working with web-sys (wasm)

Created on 11 Jun 2019  路  5Comments  路  Source: rust-lang/rls

How to reproduce:

  1. First make sure you have vscode installed and rls working properly
  2. Clone https://github.com/rustwasm/wasm-bindgen.git
  3. Open the webgl example in vscode (https://github.com/rustwasm/wasm-bindgen/tree/master/examples/webgl)
  4. Build it (I tried both wasm-pack build and cargo build). It should build with no problems.
  5. Notice that there is no autocompletion available for everything in web-sys. Autocompletion does work for your own code and other crates.

Most helpful comment

I second this.
I have no autocompletion whatsoever when using web-sys.

All 5 comments

I second this.
I have no autocompletion whatsoever when using web-sys.

  • delete ./taget folder;
  • rebuild project (wasm-pack build)
  • open vscode i wait to rebuild RLS

Same problem here, same example.
Updated the WebGl example version to latests web_sys and js_sys, and updated my toolchains and RLS.
Tried the method above, to no avail.
I do get autocompletion for web_sys:: that suggests window and some info on web_sys::window if I hover it. But that's it. No trait or method gets completed for the rest of the code.

It looks like the reason only web_sys::window shows up in autocomplete is that it's the only one in lib.rs.
The rest of the definitions are in .webidl files, which get loaded in by build.rs at build time.

Because of that, I'd say the problem lies with the web-sys crate. The most relevant issue I could find is this one, but it doesn't seem very active.

@TheGreatB3 It isn't web-sys's fault that RLS doesn't support build.rs scripts. A lot of Rust packages rely on build.rs scripts, it is a commonly used Rust feature.

However, this PR does remove the build.rs script from web-sys, so it will indirectly fix this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaccarmac picture jaccarmac  路  3Comments

nrc picture nrc  路  6Comments

paulirotta picture paulirotta  路  3Comments

AndiDog picture AndiDog  路  5Comments

liufuyang picture liufuyang  路  5Comments