huhu / rust-search-extension

🦀 The ultimate search extension for Rust
https://rust.extension.sh
Apache License 2.0
1.21k stars 52 forks source link

Offline mode no longer works #252

Closed SteveLauC closed 1 year ago

SteveLauC commented 1 year ago

Env

Steps to reproduce

  1. Enable offline mode in the setting
  2. Input the local doc path, /home/steve/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/ in my case
  3. Open a new tab, type rs and a space
  4. Type Vec
  5. Press the Enter key
  6. And nothing happens

Expected behavior

Doc for std::vec::Vec should be open.

Possible cause

Maybe the local doc path configured is wrong, but in the following demo video, we can see that if we open the URL given by Rust search extension, the corresponding doc can be successfully loaded, which probably indicates that the configured path should just be fine.

Demo

2023-04-30 20-37-06


Feel free to ask me anything that would help debug the issue:)

Folyd commented 1 year ago

Hi, @SteveLauC, thanks for the feedback. Prepending file:// before your path should work, I guess Chrome doesn't think the URL is valid if the protocol is missing. However, this should be improved to auto-adding file:// for the user.

SteveLauC commented 1 year ago

Prepending file:// before your path should work

This works:)

I guess Chrome doesn't think the URL is valid if the protocol is missing

This is true, I am so stupid hhhh


Maybe an explicit document on how to enable this feature in section Offline mode: search local Rust docs would be great? I am happy to submit a patch to this section if you want:)

Folyd commented 1 year ago

Thanks, feel free to improve the docs. 😄