ObliviousHarmony / vscode-php-codesniffer

A VS Code extension for integrating PHP_CodeSniffer.
https://marketplace.visualstudio.com/items?itemName=obliviousharmony.vscode-php-codesniffer
Other
38 stars 2 forks source link

Allow folder settings for standard and standardCustom #88

Closed dvdmlln closed 7 months ago

dvdmlln commented 7 months ago

Problem Description

The settings standard and standardCustom can not be overridden by folder settings but only by user, remote and workspace settings. However, it would be useful to override these settings for specific folders, for example if you have a workspace containing multiple folders where the location of the standardCustom file differs.

Proposed Solution

Change scope of these settings. May be usefol for other settings (ignorePatterns) as well?

ObliviousHarmony commented 7 months ago

One caveat here is that Standard Custom and Ignore Patterns look at the path as relative to the workspace root. If we used a "resource" scope this might be confusing since the path would still be relative to the root of the workspace. It also feels like it would be confusing to have it change circumstantially though based on whether this was configured or not.

What do you think? It might make sense for the standard to be resource scoped but the custom path doesn't feel right to me.

dvdmlln commented 7 months ago

Thanks for your quick repsonse! I agree that it might be confusing, but consider you have a multi-root workspace and each root has its own phpcs.xml in a different location. There would be no way to set the custom path or do I miss something?

ObliviousHarmony commented 7 months ago

consider you have a multi-root workspace and each root has its own phpcs.xml in a different location

Interesting, I was under the impression that the "window" scope would let you change settings for each workspace root rather than requiring you to set one for all workspaces. This does not seem to be the case and "resource" means the workspace folder. I'm thinking the following is appropriate:

ObliviousHarmony commented 7 months ago

Hey @dvdmlln,

I've release version 2.3.0 that includes these changes.

dvdmlln commented 7 months ago

Great, thank you!