Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to dynamically query my VSCode extension version from the extension code?

I'm writing an extension for VSCode. I would like to get the runtime version of the extension from its own code. Is there a way to do that?

I found VSCode.extensions.getExtension('myExtensionId').packageJSON but I don't know what to do with that.

like image 351
Julien H. - SonarSource Team Avatar asked May 22 '17 12:05

Julien H. - SonarSource Team


People also ask

How do I check my extensions in VS Code?

Bring up the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of VS Code or the View: Extensions command (Ctrl+Shift+X). This will show you a list of the most popular VS Code extensions on the VS Code Marketplace.

What is IntelliSense VS Code?

IntelliSense is a general term for various code editing features including: code completion, parameter info, quick info, and member lists. IntelliSense features are sometimes called by other names such as "code completion", "content assist", and "code hinting."


1 Answers

I was finally close. Using:

VSCode.extensions.getExtension('publisher.myExtensionId').packageJSON.version

seems to do the trick.

like image 97
Julien H. - SonarSource Team Avatar answered Sep 27 '22 15:09

Julien H. - SonarSource Team