yaml: Fix indentation with dictionary when editing (#40913)

Closes #39570 

Release Notes:

- Fixed indentation with dictionary when editing YAML file.

---------

Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
Coenen Benjamin
2025-11-04 12:23:34 +05:30
committed by GitHub
parent b9524837bb
commit 3ef8163357
3 changed files with 81 additions and 3 deletions
+8 -1
View File
@@ -12,6 +12,13 @@ brackets = [
auto_indent_on_paste = false
auto_indent_using_last_non_empty_line = false
increase_indent_pattern = "^[^#]*:\\s*[|>]?\\s*$"
# 1st block to match basic elements followed by ':' like 'test: ' for example
# 2nd block to match for first element in an array if it's an object
# For example:
# ```yaml
# test:
# - first: one
# ```
increase_indent_pattern = "(:?^[^#]*:\\s*[|>]?\\s*$)|(:?^\\s*-[^#]*:\\s*(:?#+.*)$)"
prettier_parser_name = "yaml"
tab_size = 2