chipsenkbeil / vimwiki-rs

Rust library and tooling to parse, render, and modify vimwiki text and files.
56 stars 2 forks source link

Support partial-rebuild of page #80

Open chipsenkbeil opened 3 years ago

chipsenkbeil commented 3 years ago

Today, the vimwiki-server must reparse an entire file if any part of it changed. For smaller files, this is fine. Even for specification.wiki, reparsing is still under 500 milliseconds.

However, this will obviously not scale.

Need to support a partial rebuild where one or more ranges are given that need to be reparsed. This is compared to the tree so we know if an inline element, an inline block element, a block element, or multiple block elements need to be re-evaluated.

chipsenkbeil commented 3 years ago

This may require switching our parser over to streaming instead of complete. This way, if we change some element to an unfinished form that could continue beyond the scope we provide, we would know.

The hard part would be for list items, tables, and other objects that may continue beyond their scope. I haven't thought through how much of a problem this would be or how to handle it. It may not be a big deal to support, or it may be really challenging.