docs(inline-tools): document static prepare() and reset() - #3028
Open
TeacherXiao wants to merge 1 commit into
Open
TeacherXiao wants to merge 1 commit into
TeacherXiao wants to merge 1 commit into
Conversation
The Inline Tools API listed the optional instance methods but never mentioned the static lifecycle hooks, even though the engine calls them for Inline Tools exactly like it does for Block Tools and Block Tunes: Tools.getListOfPrepareFunctions() walks the whole tools config, and Tools.destroy() resets every available tool. Both hooks are part of the shipped contract (BaseToolConstructable.prepare/reset) and are already covered by test/cypress/tests/tools/InlineTool.cy.ts, so this only fills the documentation gap. The wording mirrors the existing Block Tunes sections. Fixes codex-team#2401
TeacherXiao
requested review from
TatianaFomina,
gohabereg,
ilyamore88 and
neSpecc
as code owners
September 19, 2026 02:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Inline Tools documentation (
docs/tools-inline.md) does not mention the staticprepare()method, although it is supported for inline tools just like for block tools (seedocs/tools.md). The companion staticreset()method is also undocumented there.This PR adds both lifecycle hooks to the Inline Tools docs:
prepare()— prepare Tool's data on Editor's initialization (static)reset()— clean up Tool's data on Editor's destroy (static)The new sections follow the same structure and style as the existing
static get sanitizesection (description, code example, parameters table, return value).Fixes #2401