dotnet/roslyn

Smart Indent adds space before same line closing curly bracket

开放

#50,937 创建于 2021年2月1日

 (0 条评论) (1 个反应) (0 位负责人)C# (4,257 个派生)batch import
Area-IDEBugDeveloper CommunityIDE-Formatterhelp wanted

仓库指标

星标
 (20,414 个星标)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 256 个 PR)

描述

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice] When using Text Editor > C# > Tabs > Indenting: Smart, even though everything under Text Editor > C# > Code Style > Formatting is unchecked/disabled (including any "Automatically format..." checkboxes), Visual Studio 2019 still adds a space character before the closing bracket:

public int ID {get; set; } when typing {get; set;}

or

if(condition){return; } when typing {return;}

or

DB. Profiles.Select(d => new{ID=d.ID }); when typing new{ID=d.ID}

etc.

The only way to get rid of it I could find is to use "Block" instead of "Smart" for the Intending option. But then, of course, it doesn't indent new code blocks automatically, which is even more annoying.

This issue has been around in Visual Studio 2019 since the beginning. I didn't have that issue in Visual Studio 2015.


Original Comments

Feedback Bot on 1/27/2021, 06:18 PM:


Original Solutions

(no solutions)

贡献者指南