[vcFormat] `space.withinInitializerListBraces`/`space.withinSquareBrackets` are not heeded inside array initialization
まだ誰も着手していません。
評価
調査の方向性
まず、vcFormat と関連する space.withinInitializerListBraces または space.withinSquareBrackets 設定を有効にした .c ファイルで問題を再現します。配列の初期化内にある最初の指示付き初期化子を vcFormat がどのように処理するかを追跡し、その後、フォーマットによって両方の期待される例に示されたスペースが保持されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Environment
- OS and Version: Various (assuming all)
- VS Code Version: 1.117.0
- C/C++ Extension Version: 1.31.5
Bug Summary and Steps to Reproduce
Bug Summary:
When the setting C_Cpp.vcFormat.space.withinInitializerListBraces is set to true, vcFormat fails to add (and will actually remove) a space from between the opening brace and the first designated initializer of all struct members when part of the initialization of an array of structs.
Steps to reproduce:
- Ensure
C_Cpp.vcFormat.space.withinInitializerListBracesis set totrue - Add the following lines to a .c file:
typedef struct {
int member_a;
int member_b;
} MyStruct_t;
MyStruct_t array_of_structs[] = {
{ .member_a = 0, .member_b = 1 },
{ .member_a = 2, .member_b = 3 },
{ .member_a = 4, .member_b = 5 },
};
- Format the file using vcFormat
Expected behavior:
- The file should not change
Actual result:
typedef struct {
int member_a;
int member_b;
} MyStruct_t;
MyStruct_t array_of_structs[] = {
{.member_a = 0, .member_b = 1 },
{.member_a = 2, .member_b = 3 },
{.member_a = 4, .member_b = 5 },
};
The same problem also appears to afflict the first designated initializer of an array with spaces enabled inside square brackets. Here are steps to reproduce:
- Ensure
C_Cpp.vcFormat.space.withinSquareBracketsis set totrue - Add the following lines to a .c file:
int my_array[3] = {
[ 0 ] = 100,
[ 1 ] = 101,
[ 2 ] = 102,
};
- Format the file using vcFormat
Expected behavior:
- The file should not change
Actual result:
int my_array[3] = {
[0] = 100,
[ 1 ] = 101,
[ 2 ] = 102,
};
Configuration and Logs
Configurations vary; the pertinent configuration options are mentioned above.
Logs will be provided if deemed necessary. I believe this should be very easily reproduced.
Other Extensions
No response
Additional context
No response
- 主要言語
- TypeScript
- スター
- 6.2k
- フォーク
- 1.7k
- 平均マージ
- 14時間 46分
- マージ済み PR(30日)
- 61
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/vscode-cpptools のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/vscode-cpptools#14787 ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries オープンbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 担当者 1 名 ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · コメント 1 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 64/100
microsoft/vscode-cpptools#14769 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
microsoft/vscode-cpptools#14768 · コメント 1 件 ·
microsoft/vscode-cpptools の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
calcite-components needs triage refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Esri/calcite-design-system#15203 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
danielmiessler/LifeOS#2218 ·