Persistence and caching of symbol graphs with git revision tracking.
Persistence and caching of symbol graphs with git revision tracking.
(cache-path)
Returns the path to the cache file, relative to the project root.
Returns the path to the cache file, relative to the project root.
(cache-valid? cached-graph)
Checks if cached graph is valid for the current git revision. Returns true if cache exists and matches current revision.
Checks if cached graph is valid for the current git revision. Returns true if cache exists and matches current revision.
(changed-files-since-cache cached-graph)
Returns set of files that have changed since the cached revision.
Returns set of files that have changed since the cached revision.
(get-or-build-graph &
{:keys [force incremental paths]
:or {incremental true paths ["src"]}})
Gets cached graph if valid, otherwise builds a fresh one.
Options:
Returns symbol graph with metadata.
Gets cached graph if valid, otherwise builds a fresh one. Options: - :force - Force rebuild even if cache is valid - :incremental - Try incremental update if cache is stale (default true) - :paths - Paths to analyze (default ["src"]) Returns symbol graph with metadata.
(incremental-update {:keys [nodes edges files] :as cached-graph}
changed-file-set)
Updates a cached graph by re-analyzing only changed files.
Steps:
Returns updated graph.
Updates a cached graph by re-analyzing only changed files. Steps: 1. Find files changed since cache 2. Re-analyze those files 3. Remove old symbols from those files 4. Add new symbols from analysis 5. Update revision Returns updated graph.
(invalidate-cache!)
Deletes the cache file.
Deletes the cache file.
(load-graph)
Loads a cached symbol graph from disk. Returns nil if cache doesn't exist or is invalid.
Loads a cached symbol graph from disk. Returns nil if cache doesn't exist or is invalid.
(save-graph! symbol-graph revision)
Persists a symbol graph to disk with revision metadata.
Graph structure: {:revision "abc123..." :analyzed-at "2024-..." ; ISO-8601 string :nodes {...} :edges [...] :files {"src/foo.clj" {:symbols [...] :revision "abc123"}}}
Persists a symbol graph to disk with revision metadata. Graph structure: {:revision "abc123..." :analyzed-at "2024-..." ; ISO-8601 string :nodes {...} :edges [...] :files {"src/foo.clj" {:symbols [...] :revision "abc123"}}}
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |