gpt4 book ai didi

c# - Visual Studio C# 2008 : Code Folding Problem when Typing

转载 作者:太空宇宙 更新时间:2023-11-03 14:25:19 24 4
gpt4 key购买 nike

我有以下代码折叠问题:如果我有一个带有折叠方法的类,并且我在这些方法之间插入代码,则较低的代码会自动展开。例如:

class A
{
void Method1() [ folded ]

void Method2() [ folded ]

void Method3() [ folded ]
}

如果我在方法 1 和方法 2 之间插入代码,则在键入过程中会发生以下情况:

class A
{
void Method1() [ still folded: good ]

void Method4( [I typed until here and pause]

void Method2()
{
[ unfolded by VS... do not want this! ]
}

void Method3()
{
[ more auto unfolding... ugh! ]
}
}

是否有禁用 Visual Studio 完成的“智能”自动展开的选项?我只想插入方法 4 并保持方法 2 和 3 折叠。由于自动展开,我不得不再次手动折叠方法2和3。

我怀疑当我输入左括号时,VS 试图寻找一个右括号,但我找不到任何选项来禁用括号匹配。

在此感谢任何帮助。

最佳答案

提示/技巧/解决方法:您可以先输入右括号开始。这通常是我在想要注释 block 时避免展开代码的方式(从所需 block 末尾的结束标记“*/”开始,然后仅插入我的开始标记“/*”

关于c# - Visual Studio C# 2008 : Code Folding Problem when Typing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4263909/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com