Skip to content

Change yaml.format.singleQuote setting scope from window to resource #1240

@nibostwi

Description

@nibostwi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions