The vscode
commandlet allows to install, configure, and launch Visual Studio Code.
To launch VSCode for your current workspace and devonfw-ide
installation, simply run:
devon vscode
You may also supply additional arguments as devon vscode «args»
.
These are explained by the following table:
devon vscode
Argument(s) | Meaning |
---|---|
|
if provided as first arg then to command will be invoked for each workspace |
|
setup VSCode (install or update) |
|
install an additional plugin (extension) |
|
launch VSCode (default if no argument is given) |
|
same as |
|
update workspace |
|
reverse merge changes from workspace into settings |
|
reverse merge adding new properties |
|
create launch script for this IDE, your current workspace and your OS |
To be productive with VS Code you need plugins (called extensions
in VS Code).
Of course devonfw-ide
can automate this for your:
In your settings git repository create a folder vscode/plugins (click this link to see more examples and see which plugins come by default).
Here you can create a properties file for each plugin.
This is an example devonfw-extension-pack.properties:
plugin_id=devonfw.devonfw-extension-pack
plugin_active=true
The variables are defined as following:
-
plugin_id
defines the unique ID of the plugin to install. If you want to customizedevonfw-ide
with new plugins click onExtensions
at the bottom of the left navigation icon bar in VS code. Then use the search to find the plugin of your choice. If you click on it the plugin ID is displayed in grey beside the official title at the top of the plugin details page. Copy & paste the ID from here to make up your own custom config. -
plugin_active
is an optional parameter. If it istrue
(default) the plugin will be installed automatically during the project setup for all developers in your team. Otherwise developers can still install the plugin manually viadevon vscode add-plugin «plugin-name»
from the config filesettings/vscode/plugins/«plugin-name».properties
. See thesettings/vscode/plugins
folder for possible values of «plugin-name».
In general you should try to stick with the configuration pre-defined by your project.
But some plugins may be considered as personal flavor and are typically not predefined by the project config.
Such plugins should be shipped with your settings as described above with plugin_active=false
allowing you to easily install it manually.
Surely, you can easily add plugins via the UI of VS code.
However, be aware that some plugins may collect sensitive data or could introduce other vulnerabilities.
So consider the governance of your project and talk to your technical lead before installing additional plugins that are not pre-defined in your settings.
As maintainer of the settings for your project you should avoid to ship too many plugins that may waste resources but are not used by every developer.
By configuring additional plugins with plugin_active=false
you can give your developers the freedom to install some additional plugins easily.
In addition, these plugins are recommended to the user by recommendation recommendation feature of VS Code.
Be aware that the recommendations feature only works for the main workspace.
All plugins are installed separately in plugins/vscode
.
If you want to strictly manage the plugins for VS code
in your project, you can create or edit the file settings/vscode/plugins
in your settings and add this variable:
clean_plugins_on_update=true
This will wipe all plugins when an update of VS code
is performed (e.g. via devon ide update
) and reinstall all configured plugins.
While this gives you more control over the governance of the plugins and allows to remove a plugin later during project lifecycle.
However, this will delete all manually installed plugins automatically without asking.