lsdocs_plugin_sdk::testing #
Helpers for testing plugins without a host.
function context #
A context for initialize whose events (logs, progress, notified
diagnostics) are dropped.
function setup #
The setup plugin gets for params: its loader reads its settings
from params.config. Panics if they cannot be read.
function context_with_parsers #
A context for initialize whose host/parse requests go to
parsers (the first taking the extension), with the syntax that
plugin and the parsers declare, as the host would give them.
function run_transform #
pub async Runs plugin's transformer over documents the way the host does:
the collect pass over every document (if it collects), then the
documents it generates, then the apply pass with everything
collected, generated documents included. Returns each transformed
document with the diagnostics its apply pass reported. Unlike the
host, every document is passed, whatever node kinds it contains.
function run_transform_in #
pub async run_transform with the context ctx (e.g. from
context_with_parsers).