JSON error when formatting with .editorconfig #12921
Labels
bug
Feature: Code Formatting
fixed
Check the Milestone for the release in which the fix is or will be available.
Language Service
quick fix
regression
A bug that didn't exist in a previous release
Milestone
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
When .editorconfig file presents in the project, formatting c++ code will result in JSON error: conversion mismatch shown in debug output penal. As a result, the extension uses default vcFormat setting to format.
This is reproducible in version 1.22.0 or above. For version before 1.22.0 the formatting has no issue handling editorconfig file and can format code as desired.
Steps to reproduce:
Expected behavior:
No JSON error displayed and in C++ code, 'else' should stay in the same line with '}'
Configuration and Logs
Database safe to open.
LSP: (received) cpptools/formatDocument: file:///c%3A/workspace/format_test/test.cpp (id: 12)
LSP: (invoked) cpptools/formatDocument: file:///c%3A/workspace/format_test/test.cpp (id: 12)
JSON error: editorConfigSettings.cpp_indent_braces: conversion mismatch
JSON error: editorConfigSettings.cpp_indent_preserve_within_parentheses: conversion mismatch
JSON error: editorConfigSettings.cpp_indent_case_labels: conversion mismatch
JSON error: editorConfigSettings.cpp_indent_case_contents: conversion mismatch
JSON error: editorConfigSettings.cpp_indent_case_contents_when_block: conversion mismatch
JSON error: editorConfigSettings.cpp_indent_lambda_braces_when_parameter: conversion mismatch
JSON error: editorConfigSettings.cpp_indent_access_specifiers: conversion mismatch
JSON error: editorConfigSettings.cpp_indent_namespace_contents: conversion mismatch
JSON error: editorConfigSettings.cpp_indent_preserve_comments: conversion mismatch
JSON error: editorConfigSettings.cpp_new_line_scope_braces_on_separate_lines: conversion mismatch
JSON error: editorConfigSettings.cpp_new_line_close_brace_same_line_empty_type: conversion mismatch
JSON error: editorConfigSettings.cpp_new_line_close_brace_same_line_empty_function: conversion mismatch
JSON error: editorConfigSettings.cpp_new_line_before_catch: conversion mismatch
JSON error: editorConfigSettings.cpp_new_line_before_else: conversion mismatch
JSON error: editorConfigSettings.cpp_new_line_before_while_in_do_while: conversion mismatch
JSON error: editorConfigSettings.cpp_space_within_parameter_list_parentheses: conversion mismatch
JSON error: editorConfigSettings.cpp_space_between_empty_parameter_list_parentheses: conversion mismatch
JSON error: editorConfigSettings.cpp_space_after_keywords_in_control_flow_statements: conversion mismatch
JSON error: editorConfigSettings.cpp_space_within_control_flow_statement_parentheses: conversion mismatch
JSON error: editorConfigSettings.cpp_space_before_lambda_open_parenthesis: conversion mismatch
JSON error: editorConfigSettings.cpp_space_within_cast_parentheses: conversion mismatch
JSON error: editorConfigSettings.cpp_space_after_cast_close_parenthesis: conversion mismatch
JSON error: editorConfigSettings.cpp_space_within_expression_parentheses: conversion mismatch
JSON error: editorConfigSettings.cpp_space_before_block_open_brace: conversion mismatch
JSON error: editorConfigSettings.cpp_space_between_empty_braces: conversion mismatch
JSON error: editorConfigSettings.cpp_space_before_initializer_list_open_brace: conversion mismatch
JSON error: editorConfigSettings.cpp_space_within_initializer_list_braces: conversion mismatch
JSON error: editorConfigSettings.cpp_space_preserve_in_initializer_list: conversion mismatch
JSON error: editorConfigSettings.cpp_space_before_open_square_bracket: conversion mismatch
JSON error: editorConfigSettings.cpp_space_within_square_brackets: conversion mismatch
JSON error: editorConfigSettings.cpp_space_before_empty_square_brackets: conversion mismatch
JSON error: editorConfigSettings.cpp_space_between_empty_square_brackets: conversion mismatch
JSON error: editorConfigSettings.cpp_space_group_square_brackets: conversion mismatch
JSON error: editorConfigSettings.cpp_space_within_lambda_brackets: conversion mismatch
JSON error: editorConfigSettings.cpp_space_between_empty_lambda_brackets: conversion mismatch
JSON error: editorConfigSettings.cpp_space_before_comma: conversion mismatch
JSON error: editorConfigSettings.cpp_space_after_comma: conversion mismatch
JSON error: editorConfigSettings.cpp_space_remove_around_member_operators: conversion mismatch
JSON error: editorConfigSettings.cpp_space_before_inheritance_colon: conversion mismatch
JSON error: editorConfigSettings.cpp_space_before_constructor_colon: conversion mismatch
JSON error: editorConfigSettings.cpp_space_remove_before_semicolon: conversion mismatch
JSON error: editorConfigSettings.cpp_space_after_semicolon: conversion mismatch
JSON error: editorConfigSettings.cpp_space_remove_around_unary_operator: conversion mismatch
Formatting document: file:///c%3A/workspace/format_test/test.cpp
Formatting Engine: vcFormat
Other Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: