JeremyYao commented on issue #1015: URL: https://github.com/apache/daffodil-vscode/issues/1015#issuecomment-2773634544
Thank you > I'm going to start looking at this now. > > ~I also noticed that the missing highlighting issue will only occur when scrolling the viewport past the capacity which requires fetching new data.~ Disregard. Searching 'Bee' fails to highlight at file offset 19184(decimal) but if you search 'Bees' then it is correctly highlighted. > > ### Update > It looks like the search results highlighting is being reset in the `indications` array here: > > [daffodil-vscode/src/svelte/src/utilities/highlights.ts](https://github.com/apache/daffodil-vscode/blob/c117bd2fe545bc9f308c209750c1ef90efa77d8d/src/svelte/src/utilities/highlights.ts#L115-L121) > > Lines 115 to 121 in [c117bd2](/apache/daffodil-vscode/commit/c117bd2fe545bc9f308c209750c1ef90efa77d8d) > > this.store.update((indications) => { > for (const partition of offsetPartitions) { > for (let i = partition.start; i < partition.end; i++) > partition.assignByte(indications.subarray(i, i + 1)) > } > return indications > }) > > During correct highlighting the array continues to hold the appropriate values after it is returned. When the highlighting doesnt appear, the values are `0x00`. > #### Debugging UI Source > If you didn't know yet, you can actually debug the svelte source. To see what I'm referencing above follow this after starting an _Extension_ debug window and setting up the Data Editor for the text file you linked in this discussion: > > 1. Open the Webview Developer Tools: _Ctrl + Shift + P_ -> _Developer: Open Webview Developer Tools_ > 2. Select the _Sources_ tab in the tool window > 3. Search _(Ctrl + F)_ for any symbol in the source I linked above > 4. Place a breakpoint at: `return indications` > 5. Open the Memory Inspector or add a Watch expression for `indications` > > The index of the array where the selection indicator is set, then unset, is a few bytes after index **888** (decimal) or **0x378** (hex) One question: When you're debugging the Svelte source files, are you setting breakpoints in the resultant index.js file for the data editor webview as shwon below:  or setting breakpoints in the individual .svelte files in the WebView developer tools? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
