Skip to content

Implemented Data Editor Message Registry#1716

Open
stricklandrbls wants to merge 1 commit into
apache:mainfrom
ctc-oss:message-registry-implementation
Open

Implemented Data Editor Message Registry#1716
stricklandrbls wants to merge 1 commit into
apache:mainfrom
ctc-oss:message-registry-implementation

Conversation

@stricklandrbls

@stricklandrbls stricklandrbls commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Closes #1739
Closes #1659
Closes #1469
Closes #1058
Closes #669

Description

  • Implemented a Message Registry which provides type-safe message content inspection for messages sent between the data editor, dfdl extension, and the Svelte UI.
  • Restructured some legacy Svelte stores into Svelte v5 runes.
  • Resolved issues related to message content mismathcing and message content being processed by multiple data editors when the message was intended for a single data editor instance.

Wiki

  • I have determined that no documentation updates are needed for these changes
  • I have added the following documentation for these changes

Review Instructions including Screenshots

Developer Perspective Reviews

  1. In any portion of the data editor's extension source, verify that message content is appropriately inspected and the VSCode intellisense engine emits correct types when invoking this.panel.postMessage(...).
Screenshots ( dataEditorClient.ts -> 'fileInfo') image image
  1. In any portion of the data editor's Svelte UI source, verify that message content is appropriately inspected and the VSCode intellisense engine emits correct types when invoking addListener(...).
Screenshots ( DataEditorLineFeed.svelte -> 'viewportRefresh') image
  1. In any portion of the data editor's Svelte UI source, verify that message content is appropriately inspected and the VSCode intellisense engine emits correct types when invoking vscode.postMessage(...).
Screenshots ( App.svelte -> 'requestEditedData') image

Functionality Review

Verify that all message traffic behaves as expected. Message content can be identified within the ./src/ext_types/message.ts & ./src/ext_types/messageContent.ts

@stricklandrbls stricklandrbls added this to the 1.6.0 milestone Jun 11, 2026
@stricklandrbls stricklandrbls self-assigned this Jun 11, 2026
@stricklandrbls stricklandrbls added enhancement New feature or request typescript code quality Issues related to code quality data editor Issues related to the Data Editor capability debugger Issues related to the DFDL debugger capability configuration issues related to configuration labels Jun 11, 2026
@stricklandrbls stricklandrbls added the extension Issues releated to the VSCode Extension label Jun 11, 2026
@stricklandrbls
stricklandrbls force-pushed the message-registry-implementation branch from f94da23 to f2d91e0 Compare June 11, 2026 22:56
@stricklandrbls

Copy link
Copy Markdown
Contributor Author

Looks like I'll have to fix tests due to the strict type checks when transpiling with yarn tsc

@stricklandrbls
stricklandrbls force-pushed the message-registry-implementation branch 2 times, most recently from 13cb602 to a72d6ca Compare June 12, 2026 03:47
@hdalsania hdalsania moved this to In Review in daffodil-vscode v1.6.0 Jun 12, 2026
@stricklandrbls

stricklandrbls commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

@scholarsmate Is the omegaEditServerLifecycle.ts a test file? The CI jobs are failing due to a permission denied when trying to run the transpiled JS file.

Disregard, I fixed this issue.

@stricklandrbls
stricklandrbls force-pushed the message-registry-implementation branch 4 times, most recently from c99639a to 9c28091 Compare June 14, 2026 05:29
@stricklandrbls

Copy link
Copy Markdown
Contributor Author

Some changes needed to be made in order to get the updated data editor files to function properly for CI. Everything should be good to go, now.

@hdalsania

Copy link
Copy Markdown
Collaborator

@stricklandrbls Is this PR ready to test?

@stricklandrbls
stricklandrbls force-pushed the message-registry-implementation branch 2 times, most recently from e5101a8 to a8dd573 Compare June 16, 2026 03:27
@stricklandrbls

Copy link
Copy Markdown
Contributor Author

The svelte imports should now all be aliased if the path is not a sub-directory of its path.

The rest of the extension imports still need to be updated.

@lrbarber

Copy link
Copy Markdown
Collaborator

@stricklandrbls , I did some testing on this code and found that the data editor does not open automatically when starting debug. Wondering if some messages are missing? The status bar at the bottom shows no indication that it is even trying to connect to the server.
Opening the data editor manually works, but it does not get the location tracking indicator. Also, after closing the editor and restarting debug, attempting to open data editor again results in an error: A Data Editor already exists for .

@stricklandrbls

Copy link
Copy Markdown
Contributor Author

@stricklandrbls , I did some testing on this code and found that the data editor does not open automatically when starting debug. Wondering if some messages are missing? The status bar at the bottom shows no indication that it is even trying to connect to the server.

Opening the data editor manually works, but it does not get the location tracking indicator. Also, after closing the editor and restarting debug, attempting to open data editor again results in an error: A Data Editor already exists for .

Awesome thanks for testing this. I'll take a look

@stricklandrbls
stricklandrbls force-pushed the message-registry-implementation branch from a8dd573 to c648f68 Compare June 18, 2026 03:11
@stricklandrbls

Copy link
Copy Markdown
Contributor Author

@lrbarber The latest commit should fix the issue of the Data Editor not opening for the target data file in a debug session.

@lrbarber

Copy link
Copy Markdown
Collaborator

Tested Data Editor functionality thoroughly (including Profiler) and really only found one issue.
I was debugging as normal then opened a second data editor window with a different file. Everything was working fine. I closed the second window and then again tried to open a second window with the same file. It seems that closing the data editor window failed to clear in the file tracking, because it seemed to think that file was still open in a window.
image

@lrbarber lrbarber left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See comment above about closing then reopening a second file

@stricklandrbls

Copy link
Copy Markdown
Contributor Author

See comment above about closing then reopening a second file

Awesome thanks for the thorough testing. I'll work on a fix for this

@stricklandrbls

Copy link
Copy Markdown
Contributor Author

@lrbarber @hdalsania @scholarsmate - Sorry for the delay in getting updates out for this PR. I have been out of town a lot recently.

I believe that the error is fixed for sessions opened for a file that should be disposed.

@stricklandrbls
stricklandrbls requested a review from lrbarber July 7, 2026 19:04
@lrbarber

lrbarber commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

With two files opened in the data editor, I opened the Profiler on both of them.
image
They both defaulted to the same length even though the files were not the same size (or actually that big). It also appears that it does not actually look at the data and fill the graph until you change the start or end offset values. Didn't this default to the entire file?
If you change the start offset, leaving the end/length set to the default (and invalid length) the following error messages occur:
image
Expanded window show the rest of the error message:
image

Also, comparing the end offset and the length... if I start the selection at 0x00 for a length of x, shouldn't the end offset be x-1? ...or is the end offset included in the length? start 0x00, len 0x10, last byte included is 0x0f -- so what should be displayed for end offset? Now think about start 0x00, len 0x01, end offset ??

In the file below, I placed 0xFF at 0x11. The graph shows that there is an 0xFF in the selected data, but there shouldn't be, because I entered length 0x10
image

@stricklandrbls

Copy link
Copy Markdown
Contributor Author

@lrbarber thanks for testing this out. I'll take a look here in a bit

@stricklandrbls
stricklandrbls force-pushed the message-registry-implementation branch 2 times, most recently from a8b62cb to 495f715 Compare July 10, 2026 03:14
@stricklandrbls

Copy link
Copy Markdown
Contributor Author

@lrbarber - I pushed up a commit which I think completely resolves this error.

I did in fact see what you were seeing and with the latest commit it seems to be resolved.

@lrbarber

lrbarber commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

@stricklandrbls Something strange with the profiler.
image
Notice that the first 0xff is located at location 0x20.
When I profile the first few bytes everything looks OK.
image
...but when I add the 6th byte, it suddenly thinks there is an 0xff within the selected range!
image

Scrolling down reveals inconsistency in field size:
image

Also, all the numbers here are in hex, except when you hover over a bar in the bar chart, then the value at that location is shown in decimal.... byte: 256 frequency: 1

@lrbarber

lrbarber commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

@stricklandrbls After closing a data editor window (without closing the second VSCode wndow), the following messages begin scrolling in the Debug Console of the 'main' VSCode window:

rejected promise not handled within 1 second: Error: Webview is disposed
stack trace: Error: Webview is disposed
at uN.assertNotDisposed (file:///c:/Program%20Files/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:669:112635)
at get webview (file:///c:/Program%20Files/Microsoft%20VS%20Code/6a44c352bd/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:669:111596)
at SvelteUIWebviewPanel.postMessage (c:\Users\larry.barber\Documents\testing\daffodil-vscode\dist\ext\extension.js:22008:27)
at DataEditorClient.sendHeartbeat (c:\Users\larry.barber\Documents\testing\daffodil-vscode\dist\ext\extension.js:22414:38)
at Timeout._onTimeout (c:\Users\larry.barber\Documents\testing\daffodil-vscode\dist\ext\extension.js:22312:10)
at listOnTimeout (node:internal/timers:605:17)
at process.processTimers (node:internal/timers:541:7)

@stricklandrbls
stricklandrbls force-pushed the message-registry-implementation branch 2 times, most recently from a738e52 to bc36ee7 Compare July 16, 2026 21:31
@stricklandrbls
stricklandrbls force-pushed the message-registry-implementation branch from bc36ee7 to 0e038b7 Compare July 16, 2026 21:40
@stricklandrbls

Copy link
Copy Markdown
Contributor Author

@lrbarber - I believe these issues should be resolved with the latest commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Issues related to code quality configuration issues related to configuration data editor Issues related to the Data Editor capability debugger Issues related to the DFDL debugger capability enhancement New feature or request extension Issues releated to the VSCode Extension typescript

Projects

Status: In Review

3 participants