There is no new behaviour added in this commit. Just some cleanup:
- Move some shared constants to the `helpers` module
- Add comments to some of the query related modules
- Some general formatting and tidying
Ensure that upgrades can be resolved even when the upgrades pack is not
in the workspace. This is the situation when the core libraries are
resolved from the package cache.
This change works because `qlProgram.libraryPath` is the resolved
search path for compiling the query. We are guaranteed that the
appropriate core libraries are included in this query.
Note that this change avoids using extra source folders from the
workspace. Previously without using packages, we assume that all
relevant query paths are already inside the workspace. With
packaging, this is no longer the case.
It is theoretically possible that there will be extra upgrade scripts
that are not on the resolved search path, but are included in the
workspace. This situation would have worked in the past.This is not a
situation that we expect to happen in practice. And if this does happen,
I believe this is an error and all upgrades should be added explicitly
to the search path.
An open question is if this will work with downgrade scripts. If it does
not, then I don't think this change makes things any worse than before.
The Actions VM image containing v2.7.6 of the CodeQL CLI has now fully
rolled out, so we no longer need to download the latest CodeQL bundle to
use this CLI and include this repo in the ML-powered queries beta.
This was our first temporary attempt at configuration of a remote
query run. I don't think that we're using it anymore, so it simplifies
the code to remove it.
Successfully completed queries will be stored on disk and available
across restarts.
- The query results are contained in global storage.
- Metadata and a summary about a query are stored in workspace storage.
- There is a job that runs every 2 hours to determine if any queries are
old enough to be deleted.
The goal with this change is to simplify the query history to make it
possible to serialize and de serialize.
This change adds serialization support. Since query history objects are
complex, the de-serialization requires manipulation of the
de serialized object prototypes.
Two small bugs:
1. The AST view command was viewing the wrong ast when the command was
selected from the context menu. It was always selecting the active
editor instead of the item selected in the file menu.
2. The `codeql.showLogs` command was not being registered properly.
With this change, there is uniform error handling, telemetry,
and disposal.
Fixes a bug where quick eval was showing empty query text.
Previously, `getQueryText` was looking up the query text when it was
called if the specified text was empty. This was removed with the
recent changes to query history. It was also a bug since the query file
could have changed after the query was run.
This change ensures that if the quick eval position is empty, the
entire line is returned as the quick eval location.
This commit fixes two related issues with the
history view.
1. Sort order was changing after a query item completed. The fix is a
change in how we fire off the `onDidChangeTreeData` event. When the
event is fired with a single item, that item is pushed to the top of
the list. I'm not exactly sure why this wasn't happening before, but
I suspect it was because we were refreshing the list at the same time
as we were inserting the new item.
The solution here is to always refresh the entire list, instead of
single items. This is fine since re building the list is a trivial
operation. See the `refreshTreeView()` method.
With this change, the sort order is now stable.
2. Originally reported here: #1093
The problem is that the internal treeView selection was not being
updated when a new item was being added. Due to some oddities with
the way selection works in the tree view (ie- the visible selection
does not always match the internal selection).
The solution is to use the current item from the `treeDataProvider`
in `determineSelection`.
Also, this change makes the sorting more precise and fixes some typos.