简体   繁体   English

Vscode Omnisharp 总是没有快速修复

[英]Vscode Omnisharp Always No Quick Fix

The VSCode "quick fix" has never been available for me in C#. C# 中的 VSCode“快速修复”从未对我可用。

Even the most basic quick fix, like importing namespaces for class, auto-implement missing methods from interface, are not available.即使是最基本的快速修复,例如为 class 导入命名空间,从接口自动实现缺少的方法,也不可用。

I am not sure what went wrong (or maybe this is normal in VSCode? I came from VS Studio C# and these options are available there. Maybe I am just assuming too much).我不确定出了什么问题(或者这在 VSCode 中可能是正常的?我来自 VS Studio C#,这些选项在那里可用。也许我只是假设太多)。

Here is a very simple illustration of what I meant (Sorry for the Chinese error message - I am not sure how to change Omnisharp locale. It is the standard Compiler complaint saying that you are not implementing one of the interface method):这是我的意思的一个非常简单的说明(对不起中文错误消息 - 我不确定如何更改 Omnisharp 语言环境。标准编译器投诉说您没有实现接口方法之一):

没有快速修复

Environment:环境:

  • Microsoft C# Plugin (ms-dotnettools.csharp): v1.24.4微软 C# 插件(ms-dotnettools.csharp):v1.24.4
  • VSCODE: v1.66.2 (user setup) VSCODE:v1.66.2(用户设置)
  • OS: Windows 10操作系统:Windows 10

I tried:我试过了:

  • Using "Ctrl+."使用“Ctrl+”。 instead (as suggested here )相反(如建议here
  • Adding `"omnisharp.path": "latest" to Omnisharp extension settings (as suggested here )将 `"omnisharp.path": "latest" 添加到 Omnisharp 扩展设置(如此建议)
  • reinstalling omnisharp重新安装omnisharp
  • reinstalling VsCode重新安装 VsCode

So far none worked.到目前为止,没有一个工作。

I can see that if I press cmd +.我可以看到,如果我按 cmd +。 (control.) then it shows all available quick fix. (控制。)然后它显示所有可用的快速修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM