microsoft / microsoft/vscode-cpptools
Abnormal Indentation for do-while without brace
未关闭
还没有人认领这个 Issue。
bug
Feature: Code Formatting
Language Service
Visual Studio
- 主要语言
- TypeScript
- 星标
- 6.2k
- 派生
- 1.7k
- 平均合并
- 14 小时 46 分钟
- 30 天内合并 PR
- 61
描述
Environment
- OS and Version: Microsoft Windows 10 Professional Edition 10945.5131 (Latest)
- VS Code Version: 1.95.3 (system setup) (Latest)
- C/C++ Extension Version: v1.22.11 (Latest)
Bug Summary and Steps to Reproduce
Bug Summary:
Indentation for do-while without brace is wrong.
Steps to reproduce:
Enable vcFormat to format the code, then just write a do-while like:
if (...)
do
cout << "Hello World!";
while (...);
Expected behavior:
if (...)
do
cout << "Hello World!";
while (...);
Configuration and Logs
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:\\TDM-GCC-64\\bin\\gcc.exe",
"cStandard": "c17",
"cppStandard": "gnu++14",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}
Other Extensions
Only this extension has been enabled.
Additional context
The key issue is that the compiler does not compile like it looks like.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,在 Windows 上的 C/C++ 扩展中启用 vcFormat,重现该示例,并将实际缩进与预期输出进行比较。当嵌套在 if 下的无大括号 do-while 被格式化为将 while 语句缩进到 if 代码体内部时,工作即完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp, typescript, vscode
- 领域
- developer-experience, tooling
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100