apache / daffodil-vscode

Apache Daffodil™ Extension for Visual Studio Code
https://daffodil.apache.org/
Apache License 2.0
11 stars 19 forks source link

Infoset diff view does not work #986

Closed lrbarber closed 6 months ago

lrbarber commented 6 months ago

Not Sure where this feature came from or when it stopped working. Inforset file that can be displayed is a temp file.... image Solution might be to just remove this option.

scholarsmate commented 6 months ago

@jw3, In your opinion, is this a feature we should try to retain, if so, how is it supposed to work and what problem(s) does it solve?

jw3 commented 6 months ago

image

how is it supposed to work

Open the diff view, step through a debug, observing the colorized diff that compares the current infoset against the previous step/breakpoint infoset. The intent was to quickly identify changes a span of execution made to the infoset.

In your opinion, is this a feature we should try to retain

If viewing infoset changes as a colorized diff that updates as you step through a debug is useful.

lrbarber commented 6 months ago

This does not seem like something that would need to be automatically opened upon entering the debugger.

From: John Wass @.> Sent: Friday, March 8, 2024 12:34 PM To: apache/daffodil-vscode @.> Cc: Larry Barber @.>; Author @.> Subject: Re: [apache/daffodil-vscode] Infoset diff view does not work (Issue #986)

image.png (view on web)https://github.com/apache/daffodil-vscode/assets/1545372/15bb8946-f14b-4213-b03a-e8381176946f

how is it supposed to work

Open the diff view, step through a debug, observing the colorized diff that compares the current infoset against the previous step/breakpoint infoset. The intent was to quickly identify changes a span of execution made to the infoset.

In your opinion, is this a feature we should try to retain

If viewing infoset changes as a colorized diff that updates as you step through a debug is useful.

- Reply to this email directly, view it on GitHubhttps://github.com/apache/daffodil-vscode/issues/986#issuecomment-1986120382, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARJT6NEQWKWJWHCDKTYZNVLYXHY63AVCNFSM6AAAAABENEBPVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBWGEZDAMZYGI. You are receiving this because you authored the thread.Message ID: @.**@.>>

jw3 commented 6 months ago

This does not seem like something that would need to be automatically opened upon entering the debugger.

It was not originally, you can see the flow on the gif from the old wiki

https://github.com/jw3/example-daffodil-vscode/wiki#infoset-tools

lrbarber commented 6 months ago

Confirmed that even when invoked as originally intended and shown in the gif referenced in comment by jw3 above, the infoset diff viewer does not work and displays the same error shown at the top of this issue.

lrbarber commented 6 months ago

The code added from the that jw3 added 3 years ago (src/infoset.ts) appears to be unchanged:

    ctx.subscriptions.push(vscode.commands.registerCommand('infoset.diff', async () => {
        if(sid !== undefined){
            let path = ensure(tmp(sid));
            let prev = ensure(`${path}.prev`);
            vscode.commands.executeCommand ('vscode.diff', Uri.parse(prev), Uri.parse(path), "Previous ↔ Current");
        }

I wonder if this is as simple as someone removing the code that used to create the .prev file.

hdalsania commented 6 months ago

After further testing, this feature works as intended in Linux platform. This seems to be an pathing issue with Windows. @shanedell could you please test in MacOS and see if we can expand portability functionality for this?

shanedell commented 6 months ago

This working for me on MacOS. I will test on a windows VM and see if I can figure out the issue

hdalsania commented 6 months ago

@shanedell This was the issue only with Windows and I found out that Uri.Parse function used within vscode.commands.executeCommand VSCode API function was encoding the path string and replacing "\" with "%5C" encoding. By replacing Uri.Parse with Uri.file in infoset.ts for infoset diff functionality fixes the problem for windows. It works in both Windows and Linux.

@lrbarber will update the inforset.ts with following change in his existing PR #992 and push his changes soon.

 ctx.subscriptions.push(
vscode.commands.registerCommand('infoset.diff', async () => {
  if (sid !== undefined) {
    let path = ensureFile(tmpFile(sid))
    let prev = ensureFile(`${path}.prev`)
    vscode.commands.executeCommand(
      'vscode.diff',
      Uri.file(prev),
      Uri.file(path),
      'Previous ↔ Current',
      { preview: false, viewColumn: vscode.ViewColumn.Two }
    )
  }
})

)