Conversation
Walkthrough
This change refactors list type handling in the editor utility to support runtime detection of available list extensions rather than relying on hard-coded assumptions. Two new helper functions are introduced: getAvailableListTypes(editor) to identify active list extensions and liftFromLists(chain, editor) to sequentially unwrap available list wrappers. The canExecute check, list unwrapping logic, and list type conversion now use these runtime checks to determine which list node types are available, replacing compile-time references to bulletList, orderedList, and taskList.
Estimated code review effort
๐ฏ 3 (Moderate) | โฑ๏ธ ~20 minutes
๐ฅ Pre-merge checks | โ 4 | โ 1โ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | โ ๏ธ Warning | Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
| Check name | Status | Explanation |
|---|---|---|
| Description check | โ Passed | The description is directly related to the changeset, explaining the bug, root cause (taskList extension not always present), and the solution implemented. |
| Linked Issues check | โ Passed | The PR successfully addresses issue #6099 by implementing dynamic list type handling that prevents errors when taskList or other extensions are unavailable. |
| Out of Scope Changes check | โ Passed | All changes in editor.ts are focused on fixing the list type handling issue described in #6099; no out-of-scope changes detected. |
| Title check | โ Passed | The title directly addresses the main change: guarding lift calls for unavailable list extensions to prevent runtime errors when certain list extensions are not registered. |
โ๏ธ Tip: You can configure your own custom pre-merge checks in the settings.
โจ Finishing Touches ๐งช Generate unit tests (beta)- Create PR with unit tests
- Generate coding plan for human review comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
โค๏ธ ShareComment @coderabbitai help to get the list of available commands and usage tips.
Tip
CodeRabbit can generate a title for your PR based on the changes with custom instructions.Set the reviews.auto_title_instructions setting to generate a title for your PR based on the changes in the PR with custom instructions.
benjamincanac
changed the title
fix(Editor): guard calls for unavailable list extensions
fix(Editor): guard lift calls for unavailable list extensions