Add query history sorting for remote queries#1235
Conversation
Also, fix two smaller issues: - Ensure the `Open Query Directory` command opens inside the specified directory. - Ensure label changes are saved across restarts.
shati-patel
left a comment
There was a problem hiding this comment.
Thanks, this looks good to me! Just a few minor comments 🎉
extensions/ql-vscode/CHANGELOG.md
Outdated
| ## [UNRELEASED] | ||
|
|
||
| - Fix a bug where the AST viewer was not synchronizing its selected node when the editor selection changes. [#1230](https://github.com/github/vscode-codeql/pull/1230) | ||
| - Open the directory in the finder/explorer (instead of just highlighting it) when running the command "Open query directory" command from the query history view. [#1235](https://github.com/github/vscode-codeql/pull/1235) |
There was a problem hiding this comment.
Small typo ✍🏽
| - Open the directory in the finder/explorer (instead of just highlighting it) when running the command "Open query directory" command from the query history view. [#1235](https://github.com/github/vscode-codeql/pull/1235) | |
| - Open the directory in the finder/explorer (instead of just highlighting it) when running the "Open query directory" command from the query history view. [#1235](https://github.com/github/vscode-codeql/pull/1235) |
extensions/ql-vscode/CHANGELOG.md
Outdated
|
|
||
| - Fix a bug where the AST viewer was not synchronizing its selected node when the editor selection changes. [#1230](https://github.com/github/vscode-codeql/pull/1230) | ||
| - Open the directory in the finder/explorer (instead of just highlighting it) when running the command "Open query directory" command from the query history view. [#1235](https://github.com/github/vscode-codeql/pull/1235) | ||
| - Ensure query label changes are persisted across restarts. [#1235](https://github.com/github/vscode-codeql/pull/1235) |
There was a problem hiding this comment.
Maybe we can clarify what these labels are 💡 Something like this?
| - Ensure query label changes are persisted across restarts. [#1235](https://github.com/github/vscode-codeql/pull/1235) | |
| - Ensure query label changes in the query history view are persisted across restarts. [#1235](https://github.com/github/vscode-codeql/pull/1235) |
| } | ||
| } else if (finalSingleItem.t === 'remote') { | ||
| p = path.join(this.queryStorageDir, finalSingleItem.queryId); | ||
| externalFilePath = path.join(this.queryStorageDir, finalSingleItem.queryId, 'timestamp'); |
There was a problem hiding this comment.
Nice use of the timestamp file! ⏲️
| } | ||
|
|
||
| if (p) { | ||
| if (externalFilePath) { |
There was a problem hiding this comment.
This is probably a fringe case, but is it worth also throwing a Failed to open error when this path doesn't exist (e.g. if a user has deleted the timestamp for some reason)?
At the moment it fails silently.
There was a problem hiding this comment.
Hmmm...unfortunately, the revealFileInOS command does not throw an error if the file doesn't exist. I guess I can add a fs.pathExists check before trying to open.
Also, fix some changelog notes.
|
@shati-patel can you take another look and see if your comment is addressed? |
shati-patel
left a comment
There was a problem hiding this comment.
Thanks for the changes! LGTM 🙌🏽
Also, fix two smaller issues:
Open Query Directorycommand opens inside the specifieddirectory.
Fixes #1204
Checklist
ready-for-doc-reviewlabel there.