vscode-codeql icon indicating copy to clipboard operation
vscode-codeql copied to clipboard

Restore variant analysis view on restart of VSCode

Open koesie10 opened this issue 3 years ago • 0 comments

This implements persistence for the variant analysis webview, allowing the webview panel to be restored when VSCode is restarted. It's probably easier to add this now than to try to add it later.

The basic idea is that there are no real differences when opening the webview for the first time. However, when VSCode is restarted it will use the VariantAnalysisViewSerializer to restore the webview panel. In our case this means recreating the VariantAnalysisView.

To fully test this, I've also added a mock variant analysis ID as the state of the webview. This value is now randomly generated when calling the codeQL.mockVariantAnalysisView command. This allows us to test opening multiple webviews and that the webviews are restored with the correct state.

See: https://code.visualstudio.com/api/extension-guides/webview#persistence

Checklist

  • [ ] CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • [ ] Issues have been created for any UI or other user-facing changes made by this pull request.
  • [ ] [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

koesie10 avatar Sep 29 '22 11:09 koesie10