Expand description
plugin_cache submodule.
Plugin source cache — stores side effects of source/. in
SQLite.
zshrs-original infrastructure with strong C-zsh ancestry. C
zsh has bin_zcompile() (Src/parse.c) which writes a parsed
AST to a .zwc file alongside the source so subsequent reads
skip parsing. zshrs takes the idea further: rather than caching
the AST and still re-running it, we capture the side effects
(params/aliases/options/funcs set) and replay those directly —
microseconds instead of milliseconds for plugin startup. The
key/invalidation model (canonical-path + mtime) matches the
.zwc invalidation scheme C zsh uses in try_source_file()
(Src/init.c:1551).
First source: execute normally, capture state delta, write cache on worker thread. Subsequent sources: check mtime, replay cached side effects in microseconds.
Cache key: (canonical_path, mtime_secs, mtime_nsecs).
Cache invalidation: mtime mismatch → re-source, update cache.
Structs§
- Plugin
Cache - SQLite-backed plugin cache.
- Plugin
Delta - Side effects captured from sourcing a plugin file.
- Plugin
Entry - One plugin entry as exposed to the IntelliJ External Libraries view.
manageris the inferred plugin manager (zinit / oh-my-zsh / prezto / antidote / antigen / zplug / zsh-more-completions / zpwr / loose).nameis the human-readable plugin identifier (zsh-users/zsh-autosuggestions,git, etc.).rootis the absolute directory that holds the plugin’s files.
Enums§
- Alias
Kind AliasKind— see variants.
Functions§
- default_
cache_ path - Default path for the plugin cache db. Honors $ZSHRS_HOME so the shell agrees with the daemon on where state lives.
- dump_
plugins_ json - JSON consumed by the IntelliJ
AdditionalLibraryRootsProvider. Schema: - file_
mtime - Get mtime from file metadata as (secs, nsecs).
- list_
plugins - Read every entry in
pluginsand group by(manager, name, root). Returns onePluginEntryper unique plugin (de-duplicated across the many files a single plugin typically sources).