blackgear / rustdoc_seeker

rustdoc-seeker parse the `search-index.js` generated by `rustdoc` and provide fast searching ability
MIT License
5 stars 4 forks source link

The format of search-index.js changes #14

Open upsuper opened 5 years ago

upsuper commented 5 years ago

Specifically, all nulls are now replaced with N which is defined as null at the beginning of the file.

(I'm wondering whether we should really embed a JavaScript interpreter...)

blackgear commented 5 years ago

There are two major changes:

  1. null are replaced with N
  2. the search_type are changed from json object to a array, and Option<Type> isn't exists in that array if it's None

https://github.com/blackgear/rustdoc_seeker/commit/0ce7d637ce7021237522ab92d08f373eefd33780 changes:

A simple json parser is added as json.rs, determ if current_char is escaped or in string, and convert N to null.

Due to we don't use search_type in DocItem, I just deserialize it to a serde_json::Value insead of a more specific type.

Embed a Javascript interpreter like mozjs seems really large.. Duktape binding is outdated... 😭

upsuper commented 4 years ago

@blackgear It seems the format changed again, and the current version no longer works...