Search code examples
c#visual-studio-codeomnisharp

Visual Studio Code Intellisense stopped to work on C# files


I realized that I can't use ctrl + . shortcut to import other C# classes. This shortcut works just fine for other file types like typescript.

I have uninstalled and installed back again. I also installed old version of VS code too. But nothing worked.

enter image description here As I shown above, there is no import feature shows up when I do ctrl + .. Those are only the choices I was given. It's fine using without it but it's also annoying to import those files manually typed.


Solution

  • The C# language features in VS Code are provided by a service called OmniSharp .

    A couple of things you could try:

    A) Restart OmniSharp

    1. Open the Command Palette (Ctrl + Shift + P)
    2. Type Omnisharp: Restart OmniSharp

      Command Palette > OmniSharp

    B) View OmniSharp Logs

    1. Open Output Panel (Ctrl + ')
    2. Select OmniSharp Log from the dropdown)

      Output Panel > OmniSharp

    C) Enable OmniSharp Logging

    1. Enabling C# debugger logging in Omnisharp

      "configurations": [
          {
              "...": "...",
              "logging": {
                  "engineLogging": true
              }
          },
          { "...": "..." }
      ]