The yaml.format.singleQuote setting is currently defined with "scope": "window", which prevents it from being applied per-folder in multi-root workspaces or in a folder-level settings file.
Problem
Teams working in multi-root workspaces often have different YAML formatting conventions per repository. For example, one repo may require single quotes in pipeline YAML while another uses double quotes. Because yaml.format.singleQuote is window-scoped, there's no way to configure this per-folder — it can only be set globally at the user or workspace level.
When a folder-level VS Code settings file includes "yaml.format.singleQuote": true, VS Code displays the warning:
"This setting cannot be applied in this workspace. It will be applied when you open the containing workspace folder directly."
Expected behavior
yaml.format.singleQuote should use "scope": "resource" so it can be configured per-folder, consistent with how other formatting preferences like editor.tabSize and editor.insertSpaces work.
Proposed fix
In the extension's package.json configuration contribution, change the scope for yaml.format.singleQuote from "window" to "resource".
This may also apply to other yaml.format.* settings (yaml.format.bracketSpacing, yaml.format.proseWrap, yaml.format.printWidth, yaml.format.enable) — all format preferences are inherently per-file/per-folder concerns and would benefit from resource scope.
Related
The
yaml.format.singleQuotesetting is currently defined with"scope": "window", which prevents it from being applied per-folder in multi-root workspaces or in a folder-level settings file.Problem
Teams working in multi-root workspaces often have different YAML formatting conventions per repository. For example, one repo may require single quotes in pipeline YAML while another uses double quotes. Because
yaml.format.singleQuoteis window-scoped, there's no way to configure this per-folder — it can only be set globally at the user or workspace level.When a folder-level VS Code settings file includes
"yaml.format.singleQuote": true, VS Code displays the warning:Expected behavior
yaml.format.singleQuoteshould use"scope": "resource"so it can be configured per-folder, consistent with how other formatting preferences likeeditor.tabSizeandeditor.insertSpaceswork.Proposed fix
In the extension's
package.jsonconfiguration contribution, change the scope foryaml.format.singleQuotefrom"window"to"resource".This may also apply to other
yaml.format.*settings (yaml.format.bracketSpacing,yaml.format.proseWrap,yaml.format.printWidth,yaml.format.enable) — all format preferences are inherently per-file/per-folder concerns and would benefit from resource scope.Related