Obtaining a snapshot

Before you can write and run queries to analyze a project, you need a snapshot of that project. Each snapshot contains a database for a single language and a copy of the code to show your query results on. If a project uses multiple languages, then you can have a snapshot for each language.


A snapshot is usually saved and used as a zip archive. However, to use the snapshot in QL for Visual Studio you need to unzip it first. Once you've unzipped a snapshot, you can select it when running a query.

Here are a few ways to obtain a snapshot to use in QL for VS:

Downloading a snapshot from LGTM

You can download snapshots to analyze in QL for Visual Studio from any project that is visible to you in LGTM Enterprise using the Integrations tab on the project page. The QL snapshot for local analysis section contains the available snapshots for each language that has been detected.


You may find that some snapshots available to download from LGTM.com have been built by a more recent analysis process than the one available in QL for Visual Studio. If this is the case, you may not be able to run queries against these snapshots.

However, even if a new snapshot is not compatible with QL for Visual Studio, you can still analyze it in the query console on LGTM.com.

Exporting a database using the QL command-line tools

You can also create a snapshot locally using the QL command-line tools. You can convert this snapshot into the correct format for QL for VS using the export command. For more information, see Exporting data for QL plugins and extensions and LGTM in the QL command-line tools help.

What next?

Once you have obtained a snapshot, you are ready to start running QL queries.

To find out more about snapshots, and how they are created, see What is a snapshot?

Related Topics Link IconRelated Topics