stricklandrbls commented on code in PR #1564:
URL: https://github.com/apache/daffodil-vscode/pull/1564#discussion_r2692741906


##########
src/svelte/src/components/DataMetrics/DataMetrics.svelte:
##########
@@ -157,20 +157,27 @@ limitations under the License.
     })
   }
 
+  let lastProfileTarget: 'editor' | 'disk' | null = null
+  let lastRequestedTarget: 'editor' | 'disk' = 'editor'
   function requestSessionProfile(startOffset: number, length: number) {
+    lastRequestedTarget = profileTarget
     setStatusMessage(
       `Profiling bytes from ${startOffset} to ${startOffset + length}...`,
       0
     )
     vscode.postMessage({
       command: MessageCommand.profile,
       data: {

Review Comment:
   Create a data object above this `postMessage` call and deconstruct it into 
the `data` property:
   ```ts
     type ProfileMsg = {
       startOffset: number,
       length: number,
       target: ProfileTarget
     }
   
   ...
   
   const profileTargetData: ProfileMsg = {
    startOffset,
    length,
    target: profileTarget === 'disk' ? 'disk' : 'editor'
   ```
   
   I'm also unsure as to why the target would be set to undefined if the target 
was `'editor'` since there's only 2 requestable types.



-- 
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]

Reply via email to