# Run an analysis with Visual Studio Code extension

{% hint style="info" %}
Ensure the Snyk extension is [configured](/developer-tools/snyk-ide-plugins-and-extensions/visual-studio-code-extension/visual-studio-code-extension-configuration-environment-variables-and-proxy.md), [authenticated](/developer-tools/snyk-ide-plugins-and-extensions/visual-studio-code-extension/view-analysis-results-from-visual-studio-code-extension.md), and [trusted](/developer-tools/snyk-ide-plugins-and-extensions/visual-studio-code-extension/visual-studio-code-workspace-trust.md) for your Project.
{% endhint %}

You can trigger `snyk test` by using one of these methods:

* automatic (default)
* manual

Snyk Code and IaC configuration scans are triggered automatically when you open your Project and when you save any supported files. This behavior can be turned off in [user experience configuration](/developer-tools/snyk-ide-plugins-and-extensions/visual-studio-code-extension/visual-studio-code-extension-configuration-environment-variables-and-proxy.md#user-experience).

Snyk Open Source, by default, does not automatically run on save, but you can enable auto-scan in the configuration settings.

When the scan happens automatically, observe that the extension picks up the files and uploads them for analysis as soon as you open your Project or save any supported files.

Snyk Open Source requires the Snyk CLI, so it is downloaded in the background.

Snyk Code analysis runs quickly without the CLI, so results may be available quickly. If there is a delay, you see in-progress messages for each type of scan while Snyk scans your workspace for vulnerabilities and issues:

<figure><img src="/files/TjUMFl0lvh6WNMfcWtKb" alt=""><figcaption><p>Snyk scan in progress</p></figcaption></figure>

{% hint style="info" %}
Ensure your files are saved before manually running an analysis.
{% endhint %}

To trigger `snyk test` manually:

1. Click the **Snyk icon** in the sidebar to open the Snyk panel.
2. Click the **Rescan** (play) button at the top of the extension panel.

<figure><img src="/files/U48PEpClWvK84xM8Eios" alt="" width="355"><figcaption><p>Manually trigger a Snyk analysis</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snyk.io/developer-tools/snyk-ide-plugins-and-extensions/visual-studio-code-extension/run-an-analysis-with-visual-studio-code-extension.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
