Skip to content

Conversation

@mark-friedman
Copy link
Collaborator

No description provided.

Note that there is still an issue with the packaging, such that just importing from `core` doesn't work.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR refactors and packages parts of the lexical variable plugin while adding documentation on creating blocks from fields (BYOB). Key changes include:

  • New documentation explaining how to build custom blocks using the lexical variable fields and mixins
  • Introduction of the simple_local_declaration_statement block and refactored variable getter/setter implementations
  • Updates to generator functions, tests, and mixins for consistent naming and improved modularity

Reviewed Changes

File Description
block-lexical-variables/README.md Expanded documentation for BYOB (build your own blocks) and improved section organization
block-lexical-variables/src/blocks/variable-get-set.js New block implementations and refactored variable renaming logic
block-lexical-variables/src/mixins.js Added and refined mixin functions for contextual lexical variable scope handling
block-lexical-variables/tests/mocha/field_lexical_var.js Updated tests to use getDeclaredVars in place of the deprecated getVars method
block-lexical-variables/src/generators/* Updated generator functions to use the new forBlock API and use Order constants consistently
Others Adjustments in various files (UNITTESTING.md, blocks.js, etc.) to integrate the changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

block-lexical-variables/tests/mocha/field_lexical_var.js:1271

  • The test helper now uses getDeclaredVars instead of getVars, which is consistent with refactored naming; please confirm that all tests and references are updated accordingly.
return this.workspace.getBlockById(id).getDeclaredVars()[0];

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mark-friedman mark-friedman merged commit d672e1e into main Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants