Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

rls autocompletion not working with web-sys (wasm) #1489

Open
Barsonax opened this issue Jun 11, 2019 · 5 comments
Open

rls autocompletion not working with web-sys (wasm) #1489

Barsonax opened this issue Jun 11, 2019 · 5 comments

Comments

@Barsonax
Copy link

Barsonax commented Jun 11, 2019

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.
@delbato
Copy link

delbato commented Jul 3, 2019

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

@ljubisa-milivojevic
Copy link

ljubisa-milivojevic commented Jul 28, 2019

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

@tiesselune
Copy link

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.

@TheGreatB3
Copy link

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.

@Pauan
Copy link

Pauan commented Mar 1, 2020

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants