Gruntfuggly / global-config

Allows copying of shared config settings in vscode
MIT License
12 stars 4 forks source link

Global config of site specific settings #9

Closed jmevalentin closed 3 years ago

jmevalentin commented 4 years ago

I'm trying to configure vscode for Drupal using this guide: https://www.drupal.org/docs/develop/development-tools/configuring-visual-studio-code

Some settings require site specific values. One is for xdebug and has the following: "pathMappings": { "/path/to/drupal/webroot": "${workspaceFolder}" }, Another is for Intelephense, requiring the Drupal core path: // Intelephense and Drupal >8 only. This should be set to the path to core/index.php. "intelephense.environment.documentRoot": "core/index.php",

What's the best way to manage these settings? Do I still have to create a settings.php in the site's local directory and somehow have both loaded by VSC?

Gruntfuggly commented 4 years ago

Hi - To be honest, I don't know. This extension simply copies a default set of settings files to a new workspace, into the .vscode folder. If you manually set up a workspace, you could then copy the settings from that workspace somewhere and use them as your global defaults.

jmevalentin commented 4 years ago

Hmm, maybe I misunderstood then. I was creating a settings.json file directly in the ~/.vscode directory. But for xdebug you need a site specific path, so you have to change this manually each time you switch projects?

Gruntfuggly commented 4 years ago

I guess so. The idea of this extension was to copy files that are the same for each workspace, as vscode didn't provide global tasks and debugger definition files. I think it now supports global task definitions though.

It sounds like it's the opposite of what you need.

jmevalentin commented 4 years ago

Well it's definitely still useful, and I appreciate you providing it. I just thought it could be possible to have a truly global configuration. Perhaps it would be better to name it "Copy Configuration". I'm not sure yet how to use it to copy the configuration, tbh.

Gruntfuggly commented 4 years ago

Please can you explain what you mean by 'truly global'? It's currently global in the sense that the same files can be used for any workspace. If you need a file that is tailored to a particular workspace, by definition it can't be global?

To copy any global configuration files that you do want, just put them in ~/.vscode or whatever the folder you've configured in global-config.folder. Then when you open a new workspace, press F1 and enter Global Config: Copy Global Config. Hopefully that should all be clear from the extension page. Please let me know if it isn't.

Gruntfuggly commented 3 years ago

Hi - did you have any further feedback on this, if not I'd like to close the issue.