VersionLens for Visual Studio Code

This project is active, not sponsored or funded.

VersionLens shows version information when opening a package or project file in VS Code. It abides by semver rules and uses the Node Semver package to compare and sort versions.

Contents
Supported Languages & Ecosystems
VersionLens supports a wide range of ecosystems:
Note: TOML files require an extension that registers the TOML language with VS Code (e.g., Even Better TOML).
Select the V icon in the package/project file toolbar.
You can also find this in the editor ... (secondary) menu as Show release versions.
You can also set the default startup state using versionlens.suggestions.showOnStartup in your settings.
Can I see pre-release versions?
Yes, select the tag icon in the package/project file toolbar.
You can also find this in the editor ... (secondary) menu as Show prerelease versions.
You can also set the default startup state using versionlens.suggestions.showPrereleasesOnStartup.

Can I check for package vulnerabilities?
VersionLens integrates with OSV.dev to highlight vulnerable packages directly in your manifest files.
- Editor Diagnostics: If a vulnerability is found for your current version, a red squiggle will appear. Hovering over the version will show the vulnerability details and a direct link to the advisory.
- Update Safeguards: If you click to update to a version that is known to be vulnerable, a modal confirmation will appear to prevent accidental updates to insecure versions.
- Visual Indicators: Updatable versions with known vulnerabilities are marked with a
⚠️ indicator in the CodeLens title.
Note: This feature is enabled by default and can be toggled using the versionlens.suggestions.showVulnerabilities setting.
Will this extension install packages for me?
Yes, you can define a custom task that runs when you save a package document.
To set this up, follow the Custom Install Task Guide.
How do I install this extension?
Install via the VS Code Extension Gallery.
Manual Installation
Visit the Releases page for VSIX instructions.
Installation Troubleshooting
If you are unable to install the extension, try a clean install:
- Shut down VS Code.
- Delete the extension folder:
{home}/.vscode/extensions/pflannery.vscode-versionlens.
- Restart VS Code and reinstall.
Note: Check the Log (Extension Host) in the Output channel for specific errors during installation.

How do I troubleshoot this extension?
- CodeLens Enabled: Ensure
"editor.codeLens": true is set in your settings.
- Action Icons: Ensure
"workbench.editor.editorActionsLocation": "hidden" is not set.
- Clear Cache: Open the Command Palette (
Ctrl+Shift+P / Cmd+Shift+P) and type VersionLens: Clear cache.
- Cache duration is managed by
versionlens.caching.duration (default is 3 minutes).
- Logging: Set your log level to
debug via the Command Palette (Developer: Set Log Level) or the VersionLens output channel.

- Developer Tools: If no logs are visible, check for errors in the VS Code Developer Tools (
Help > Toggle Developer Tools).
Commands & Settings
For a full list of available commands and configuration options, see the Commands & Settings Guide.
License
Licensed under ISC.
Copyright © 2016+ contributors