zed icon indicating copy to clipboard operation
zed copied to clipboard

Install extensions declaratively or via CLI

Open thomasschafer opened this issue 1 year ago • 4 comments

Check for existing issues

  • [X] Completed

Misc notes

It would be great to be able to install extensions without relying on the UI: preferably declaratively using settings.json (or another config file), or via the zed shell command. Is this either possible or planned?

thomasschafer avatar Apr 24 '24 14:04 thomasschafer

It would be great to be able to install extensions without relying on the UI: preferably declaratively using settings.json (or another config file), or via the zed shell command. Is this either possible or planned?

We have an auto_install_extensions setting in Zed v0.133.x (releasing to Preview today) that allows you to indicate what extensions should be installed on startup:

https://github.com/zed-industries/zed/blob/bd77232f650cb650101d546262d9106b97ab7771/assets/settings/default.json#L593-L599

I suspect it's not exactly what you're looking for, but I figured I would mention it all the same.

maxdeviant avatar Apr 24 '24 17:04 maxdeviant

We have an auto_install_extensions setting in Zed v0.133.x (releasing to Preview today) that allows you to indicate what extensions should be installed on startup: I suspect it's not exactly what you're looking for, but I figured I would mention it all the same.

Useful to know, thanks for the heads up! Am I right in thinking that this won't work for arbitrary extensions, just language specific extensions that Zed would have previously prompted for? I've just installed the 0.133 preview and added

  "auto_install_extensions": {
    "Dracula": true
  },

as a test and the extension hasn't been installed, and I couldn't work out whether this was expected from a glance at the code

thomasschafer avatar Apr 24 '24 22:04 thomasschafer

We have an auto_install_extensions setting in Zed v0.133.x (releasing to Preview today) that allows you to indicate what extensions should be installed on startup: I suspect it's not exactly what you're looking for, but I figured I would mention it all the same.

Useful to know, thanks for the heads up! Am I right in thinking that this won't work for arbitrary extensions, just language specific extensions that Zed would have previously prompted for? I've just installed the 0.133 preview and added

  "auto_install_extensions": {
    "Dracula": true
  },

as a test and the extension hasn't been installed, and I couldn't work out whether this was expected from a glance at the code

It should work for all extensions, but you need to use the extension ID:

"auto_install_extensions": {
  "dracula": true
},

maxdeviant avatar Apr 24 '24 22:04 maxdeviant

It should work for all extensions, but you need to use the extension ID:

"auto_install_extensions": {
  "dracula": true
},

Ah yes, that works perfectly - thanks so much! 🙌 That was what I was looking for, so I'm happy to close this issue (unless you wanted it left open for any reason)

thomasschafer avatar Apr 25 '24 09:04 thomasschafer

It should work for all extensions, but you need to use the extension ID:

"auto_install_extensions": {
  "dracula": true
},

Ah yes, that works perfectly - thanks so much! 🙌 That was what I was looking for, so I'm happy to close this issue (unless you wanted it left open for any reason)

If your use-case is resolved, then I think we can go ahead and close.

maxdeviant avatar Apr 25 '24 19:04 maxdeviant

This doesn't seem to be working. My config: https://github.com/cweagans/dotfiles/blob/9ce068606ad636b9ee0b9efedcfbab9936994e27/dot_config/zed/private_settings.json#L2-L44

I installed Zed through Homebrew, pulled in this config, and started Zed. Is there anything I should do to trigger this functionality or should it be fully automated?

cweagans avatar Aug 25 '24 18:08 cweagans

Ah, checked the logs and it looks like the extensions were installed, but I had to restart Zed so that the extensions were actually detected.

cweagans avatar Aug 25 '24 19:08 cweagans