Skip to content

feat: edits to mission source for the editor's forms and map - #1211

Closed
vdmkenny wants to merge 1 commit into
mainfrom
feat/source-edits
Closed

vdmkenny wants to merge 1 commit into
mainfrom
feat/source-edits

Conversation

@vdmkenny

Copy link
Copy Markdown
Collaborator

The editor's record forms and Scene view (OpenReliant/openreliant-editor#8, OpenReliant/openreliant-editor#2) change records in the source as they're edited. This adds what they need from the library:

  • Where each node ends. The bridge copies the end of each node from Luau's parser. A table's item runs from its key to the end of its value.
  • Edits (dte.source.edit): set an argument, set or remove a field of a declaration's table, and add a declaration. Each edit replaces one span, so comments and layout stay. A new field goes on a new line with the same indent in a table over several lines, and on the same line otherwise; a trigger without fields gets a table before its function. Values are written as the decompiler writes them.
  • language.fieldsOf: the table of fields each declaration takes and which argument it is, for the editor's forms. A test ties it to the declarations' signatures.
  • events.reached_reach is public, for the map's ship_reached range.

Checks: zig build test (2665/2666, 1 skipped), zig fmt --check, make check-files, make check-missions (75 missions, 0 failing; the guide's change builds).

Closes #1210

The editor's record forms and Scene view change records in the source as
they are edited, so the source keeps its comments and layout instead of
being written again from the mission.

Each node of the syntax tree now has where it ends, from Luau's parser, and
dte.source.edit makes the edits: set an argument, set or remove a field of a
declaration's table, and add a declaration. language.fieldsOf gives the
table of fields each declaration takes, for a form, and ShipReached's reach
is public for the map to draw.

Closes #1210
@vdmkenny

Copy link
Copy Markdown
Collaborator Author

Closing. The editor makes its own edits to the source, so OpenReliant's library stays as it is, and the link stays the original's protocol plus the messages that docs/engine/editor-link.md and #1126 document.

@vdmkenny vdmkenny closed this Oct 14, 2026
@vdmkenny
vdmkenny deleted the feat/source-edits branch October 14, 2026 23:47
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.

Mission source: where each node ends, and edits for editors

1 participant