Version Lens for Visual Studio Code

This project is active
, not sponsored and not funded.
This extension shows version information when opening a package or project for one of the following:
Version lens abides to semver rules and uses the Node Semver package to compare and sort versions.
Contents
How do I install this extension?
Follow this link on how to install vscode extensions
Click the V icon in the package\project file toolbar.
You can also choose the default startup state by setting versionlens.suggestions.showOnStartup

Can I see pre-release versions?
Yes, click on the tag icon in the package\project file toolbar.
You can also choose the default startup state by setting versionlens.suggestions.showPrereleasesOnStartup

Will this extension install packages?
You can define a task that will run when you save a package document. (runs only when there are dependency changes)
The install task needs to be defined in your tasks.json.
You then set the versionlens.{provider}.onSaveChanges
setting to the your install task label.
Example
// in your settings.json snippet
{ "versionlens.npm.onSaveChanges": "versionlens npm install" }
// tasks.json
{
"label": "versionlens npm install",
"command": "npm",
"type": "shell",
"args": ["install"],
"options": {
// sets the cwd to the current file dir
"cwd": "${fileDirname}"
},
// customizable settings
"presentation": {
"echo": true,
"reveal": "always",
"panel": "shared",
"clear": true,
},
}
NOTE
- If your provider already detects changes then installs packages (i.e. dotnet c# extension) then you won't need to have a custom install task
- Versionlens will need to be enabled before making and saving changes
- Will not run anything when the
onSaveChanges
setting is set to the default value of null
- Optionally you can add the task to your user
tasks.json
file if you dont want to define the task for every project. This is done by pressing ctrl+p
then selecting Tasks: Open User Tasks
.
- If the specified task is not found then vscode (by default) will prompt which task you want to run (this will never be saved in to your versionlens settings).
- Ensure to set the
task.options.cwd
to the built-in predefined variable called ${fileDirname}
when running an install task
Can I install this extension manually?
Yes goto the release page for instructions
I'm not able to install this extention
Try a clean install:
- Shut down vscode
- Delete the extension folder
{home}/.vscode/extensions/pflannery.vscode-versionlens*
- Open vscode and try reinstalling the extension again
If that fails then have a look in the Log (Extension Host)
channel. Report it here if that doesn't help.

How do I troubleshoot this extension?
Ensure you have "editor.codeLens": true
set in your settings.
Ensure that the package\project file open is using the correct file type. i.e. json instead of jsonc

Version lens writes a log to an output channel in vscode.
If your experiencing issues please set your versionlens.logging.level
to debug
(vscode needs to be restarted)
Then open the channel like:

In the worst case no logs are output. There maybe an error in the developer tools of vscode. You can open the dev tools from the help menu
in vscode (Ctrl+Shift+I)
License
Licensed under ISC
Copyright © 2016+ contributors