我不知道发生了什么,但是突然之间,OmniSharp在VSCode中变得非常慢。
有时,自动完成会立即工作,有时需要几分钟时间,跳到定义之类的地方也是一样。
如果我在局部变量上再次禁用OmniSharp自动完成,有时OmniSharp会给我一个函数列表,这些函数将完成我正在输入的内容,但不会自动选择我已经写了一半的函数。
有什么方法可以调试它并找出原因吗?
发布于 2022-10-19 06:33:58
如果您的问题是确定原因,请检查Outuput窗口中的"Omnisharp日志“:

在那里看到一些警告甚至错误是正常的,但是不应该有太多的错误。
您还可以尝试增加日志级别以查看更多信息。
如果需要临时解除,还可以尝试以下设置:
"omnisharp.analyzeOpenDocumentsOnly": true,
// Flip this on/off and feel the difference
"omnisharp.enableAsyncCompletion": false,
// Flip this on/off and feel the difference
"omnisharp.enableMsBuildLoadProjectsOnDemand": false,
// Maybe more cost up front helps later
"omnisharp.projectLoadTimeout": 300,
// Only if using .NET6+,
// If not, read about the setting, or make sure you set it to false
"omnisharp.useModernNet": true,
// This slows down start normally,
// but see if it makes a difference after that
"omnisharp.path": "latest",
// Only set this to false to experiment
// If it improves things, then some analyzer NuGet is the cause
"omnisharp.enableRoslynAnalyzers": false,
// Also check "omnisharp." and "csharp." settings for any
// setting that has the word "suppress" and remove them
// so you can see all errors and warnings from omnisharphttps://stackoverflow.com/questions/48138280
复制相似问题