Article
· Oct 13, 2023 2m read

How to provide VS Code settings, snippets and debug configurations to everyone working server-side in a shared namespace

When you use VS Code to edit source code, the settings model allows you to specify folder-specific values for some settings by using a settings.json file located in a .vscode sub-folder of the workspace root folder. A value set here takes precedence over one from your personal settings when you are working within that workspace root folder.

If you use an isfs-type workspace to operate directly in a namespace on a server, you first need to configure that server to support a special .vscode folder for each of its namespaces, present and future. The folder can also provide folder-specific code snippets and debug launch configurations.

One benefit gained from setting up this feature is that by putting a setting (or snippet, or debug configuration) on the server it immediately becomes available to every VS Code user working on that server.

For example, our Deltanji source control integrates with VS Code using an extension. Using server-side settings storage allows sites to be sure that every developer connecting to a particular namespace will get the same results from the Deltanji extension in cases where those results depend on a setting.

Configuring a server to host and publish a .vscode subfolder for each of its namespaces is a one-time task. The manual steps are documented, but if ZPM / IPM is available on your server you can perform them automatically by installing the vscode-per-namespace-settings package. More details about that package, including its source code, are available on Open Exchange.

Discussion (1)2
Log in or sign up to continue