Skip to content

Support editing OpenXML package parts - #33

Merged
sergey-tihon merged 3 commits into
mainfrom
feature/edit-content
Oct 6, 2026
Merged

sergey-tihon merged 3 commits into
mainfrom
feature/edit-content

Conversation

@sergey-tihon

Copy link
Copy Markdown
Owner

Summary

  • Replace the read-only content provider with a writable FileSystemProvider for XML parts.
  • Validate XML before writing and report save failures so malformed edits remain unsaved.
  • Bump the extension version to 0.4.0.

Verification

  • Targeted save regressions: 2 passed.
  • Full server suite and ./build.sh -p Build: 8 tests passed.
  • VS Code Extension Development Host smoke test: valid edit persisted; malformed save was rejected without changing the package.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 19:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

XML whitespace preservation and the declared VS Code compatibility must be corrected.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds writable OpenXML XML-part editing through a VS Code file-system provider.

Changes:

  • Adds validated XML persistence and regression tests.
  • Replaces read-only virtual documents with writable file-system resources.
  • Bumps the extension to version 0.4.0.
File Description
tests/​Server.Tests/​OpenXmlApi.Tests.fs Tests successful and malformed saves.
src/​Shared/​Shared.fs Updates save-result contract.
src/​Server/​OpenXmlApi.fs Validates and writes XML parts.
src/​extension/​Remoting.fs Updates save API response handling.
src/​extension/​Model.fs Implements the file-system provider.
src/​extension/​Helpers.fs Adds UTF-8 conversion helpers.
src/​extension/​extension.fs Registers the writable provider.
src/​extension/​Agent.fs Removes obsolete save messaging.
release/​package.json Bumps extension version.
RELEASE_NOTES.md Documents editable XML parts.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Server/OpenXmlApi.fs Resolved
Comment thread src/extension/extension.fs Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The filesystem provider returns incorrect size metadata and does not notify watchers after successful writes.

Review effort: Balanced
Findings: None

Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Report accurate byte size for XML resources

src/​extension/​Model.fs:141

stat reports every XML part as a zero-byte file even though readFile returns non-empty UTF-8 data. FileStat.size is the byte count of the resource and is used by VS Code and extensions for metadata and large-file handling; return the encoded content length (or cache equivalent metadata) instead of a constant zero.

This issue also appears on line 167 of the same file.

@sergey-tihon
sergey-tihon merged commit ae9abfd into main Oct 6, 2026
2 checks passed
@sergey-tihon
sergey-tihon deleted the feature/edit-content branch October 6, 2026 20:10
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