Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON-formatted cli extension info (details + enabled/disabled) #72970

Closed
jsejcksn opened this issue Apr 27, 2019 · 8 comments
Closed

JSON-formatted cli extension info (details + enabled/disabled) #72970

jsejcksn opened this issue Apr 27, 2019 · 8 comments
Assignees
Labels
extensions Issues concerning extensions *out-of-scope Posted issue is not in scope of VS Code

Comments

@jsejcksn
Copy link

See #19083, #37620, #69090

Currently, I know of two ways to get extension information:

One way, in a shell:

code --list-extensions [--show-versions]

which produces the an extension id (and, optionally, version) followed by a newline character for each installed extension:

dbaeumer.vscode-eslint[@1.8.2]
ms-vsliveshare.vsliveshare[@1.0.91]
...

And the other way, in VS Code:

  1. Toggling the Extensions panel
  2. Right-clicking on an extension
  3. Selecting "Copy Extension Information"

vscode-copy-extension-information

which produces this output in the clipboard:

Name: ESLint
Id: dbaeumer.vscode-eslint
Description: Integrates ESLint JavaScript into VS Code.
Version: 1.8.2
Publisher: Dirk Baeumer
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint

I would like the ability to output extension information in JSON format when using the cli argument --list-extensions. This option could be implemented with an additional argument such as --json and used like the --show-versions argument:

code --list-extensions --json

I propose that the output would be a JSON-formatted array of objects representing each installed extension containing the information provided via the "Copy Extension Information" command, and additionally providing a boolean attribute for whether the extension is enabled. It would look like this:

[
  {
    "name": "ESLint",
    "id": "dbaeumer.vscode-eslint",
    "description": "Integrates ESLint JavaScript into VS Code.",
    "version": "1.8.2",
    "publisher": "Dirk Baeumer",
    "link": "https://marketplace.visualstudio.com/items?itemname=dbaeumer.vscode-eslint",
    "enabled": true
  },
  {
    "name": "Live Share",
    "id": "ms-vsliveshare.vsliveshare",
    "description": "Real-time collaborative development from the comfort of your favorite tools.",
    "version": "1.0.91",
    "publisher": "Microsoft",
    "link": "https://marketplace.visualstudio.com/items?itemname=MS-vsliveshare.vsliveshare",
    "enabled": false
  }
]

This would allow programmatic retrieval of extension information and status.

@vscodebot vscodebot bot added the extensions Issues concerning extensions label Apr 27, 2019
@jsejcksn jsejcksn changed the title JSON-formatted cli extension info (enabled/disabled) JSON-formatted cli extension info (details + enabled/disabled) Apr 27, 2019
@sandy081
Copy link
Member

@jsejcksn What is the usecase and why you need this?

@sandy081 sandy081 added the info-needed Issue requires more information from poster label Apr 30, 2019
@jsejcksn
Copy link
Author

Hi @sandy081: I am not aware of another way to get a list of all installed extensions with information about which ones are enabled and which ones are disabled. This export would be a first step in being able to store the information so that the current extension state can be replicated in another instance of VS Code.

@sandy081
Copy link
Member

sandy081 commented May 2, 2019

So you are trying to sync extensions? There is an extension already in market place that does it already - https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync

Have you tried this?

@jsejcksn
Copy link
Author

jsejcksn commented May 2, 2019

Yes, I have tried that extension previously, but it introduces dependencies which don't need to be present for this functionality:

  • installation of that extension
  • a GitHub account
    • giving that extension OAuth access to a GitHub account

Using that extension also makes the user's settings public by syncing them to a GitHub gist. GitHub gists cannot be made private, only "secret" (security through obscurity).

@sandy081
Copy link
Member

sandy081 commented May 3, 2019

I do not think we have plans/cycles to implement this request unless it is highly requested. So I would close this as out of scope and revisit this if more users request for the same.

On the other hand, We have a feature request to support synchronisation of settings across machines. Synchronising extensions will also be supported while implementing that. #2743

@sandy081 sandy081 added *out-of-scope Posted issue is not in scope of VS Code and removed info-needed Issue requires more information from poster labels May 3, 2019
@vscodebot
Copy link

vscodebot bot commented May 3, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed May 3, 2019
@jsejcksn
Copy link
Author

jsejcksn commented May 6, 2019

@sandy081 How can I get a list of enabled extensions vs disabled extensions in VS Code?

@sandy081
Copy link
Member

sandy081 commented May 7, 2019

@jsejcksn You cannot right now, but there is a request already asking for it - #14444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions Issues concerning extensions *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

2 participants