自上次更新以来,Visual Studio Mac 在 C# 中键入左大括号后跟“return”后,不会将光标放在新行上

Visual Studio Mac doesn't put the cursor on a new line after typing an open curly brace followed by "return" in C# since last update

提问人:JustSmile 提问时间:7/8/2023 更新时间:7/8/2023 访问量:33

问:

自上次更新以来,当我在大括号后点击“返回”时,它看起来像这样:

private void MyMethod() {
|<cursor is here>}

它看起来像什么,我希望它看起来像这样:

private void MyMethod()
{
    |<cursor is here>
}

这篇文章中建议的解决方案对我不起作用:Visual Studio 新行大括号格式问题

我想我知道相关的设置,但我尝试了几乎所有的组合都没有成功:enter image description here enter image description here enter image description here enter image description here

C# 换行符 visual-studio-mac 大括号 自动套用格式

评论

0赞 Matthew Watson 7/8/2023
可以肯定的是:您是否正在运行任何可能干扰此内容的插件(例如 Resharper)?
0赞 JustSmile 7/8/2023
我没有/使用任何插件。
0赞 Matt Ward 7/8/2023
这是一个 bug,将在 Visual Studio for Mac 17.6.1 中修复。编辑器中处理程序的顺序在早期版本的 Visual Studio for Mac 中没有确切的顺序,这可能会影响大括号处理程序的工作方式。重新启动 Visual Studio for Mac 有时可以解决此问题。developercommunity.visualstudio.com/t/......

答: 暂无答案