Visual Assist X:大括号在重构期间移动

发布于 2024-08-15 14:31:39 字数 358 浏览 4 评论 0原文

我使用 Visual Assist X,从 2009 年 1 月 5 日开始构建,但之前的版本也出现了同样的问题。 (我在 MSVS 2005 上运行它)

当我进行一些重构(例如提取方法)时,一切都很好,但所有花括号都向前移动。例如,在重构之前,代码看起来像这样:

while (expr)
{
  doSmth();
}

重构之后:

while (expr)
  {
  doSmth();
  }

因此,我需要手动移动所有括号。当然,这个问题很小,但是当你进行大量重构时,它就会变得很烦人。这是一个错误还是只是默认设置?那么,有人知道解决方法吗?

I use Visual Assist X, build from 05.01.2009, but the same problem occurred in the previous releases as well. (I run it on MSVS 2005)

When I do some refactoring (like extracting a method), everything's fine, but all the curly braces move forward. For example, before refactoring the code looked like this:

while (expr)
{
  doSmth();
}

After refactoring:

while (expr)
  {
  doSmth();
  }

So, I need to move manually all the brackets. Sure, the problem is minor, but it becomes annoying when you do a lot of refactoring. Is it a bug or just default settings? So, does anyone know a workaround?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

还给你自由 2024-08-22 14:31:39

看起来 Visual Assist 从 Visual Studio 大括号放置设置中得到了提示。要调整此选项,请访问“工具”|“选项”,然后导航到“文本编辑器”、“C/C++”、“格式”。确保“缩进大括号”未被选中。

(在摆弄文本后,有关一般格式问题的一个相关提示是,您可以让 Visual Studio 为您重新格式化。将光标放在错误位置的大括号之一上,按 Ctrl+Shift+](将选择范围扩展到匹配的大括号),然后按 Ctrl+K、Ctrl+F(重新格式化选择)。)

顺便说一句,对于真正的 Visual Assist 错误,论坛是一个好去处:

http://www.wholetomato.com/forum/

他们看起来只是一家小公司,但他们通常非常擅长跟踪未解决的问题。

It looks like Visual Assist takes its cue from the Visual Studio brace placement settings. To tweak this option, visit Tools|Options, then navigate to Text Editor, C/C++, Formatting. Make sure "Indent braces" is unticked.

(A related tip for general formatting issues after fiddling around with text is that you can get Visual Studio to do the reformatting for you. Put the cursor on one of the mispositioned braces, press Ctrl+Shift+] (extend selection to matching brace), then press Ctrl+K, Ctrl+F (reformat selection).)

BTW for genuine Visual Assist bugs the forum is a good place to go:

http://www.wholetomato.com/forum/

They seem to be only a small company, but they're generally pretty good at keeping track of open issues.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文