Search Unity

Bug Intellisense Not Working Correctly in VSCode

Discussion in 'Editor & General Support' started by jackt0310, Sep 7, 2022.

  1. jackt0310

    jackt0310

    Joined:
    Aug 2, 2020
    Posts:
    4
    I can't seem to get Intellisense to work for Unity C# in VSCode no matter what I do. I've tried seemingly every solution online, including reinstalling VSCode entirely and changing the version of the C# package for VSCode. I've tried everything in this link twice, including uninstalling and reinstalling.

    "Received response for X but could not find request." shows up when there should be some kind of tooltip or autocomplete. The warning for the symbol is new, I'm not sure what that is about.

    Code (CSharp):
    1. Starting OmniSharp server at 9/6/2022, 11:34:23 PM
    2.     Target: c:\Users\Jack\Documents\GitHub\Intellisense\Intellisense.sln
    3.  
    4. OmniSharp server started.
    5.     Path: c:\Users\Jack\.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64\.omnisharp\1.39.0\OmniSharp.exe
    6.     PID: 17376
    7.  
    8. [info]: OmniSharp.Stdio.Host
    9.         Starting OmniSharp on Windows 6.2.9200.0 (x64)
    10. [info]: OmniSharp.Services.DotNetCliService
    11.         Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
    12. [info]: OmniSharp.Services.DotNetCliService
    13.         Using the 'dotnet' on the PATH.
    14. [info]: OmniSharp.Services.DotNetCliService
    15.         DotNetPath set to dotnet
    16. [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    17.         Located 1 MSBuild instance(s)
    18.             1: Visual Studio Build Tools 2022 17.3.32825.248 17.3.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin"
    19. [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    20.         Registered MSBuild instance: Visual Studio Build Tools 2022 17.3.32825.248 17.3.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin"
    21. [info]: OmniSharp.WorkspaceInitializer
    22.         Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
    23. [info]: OmniSharp.Cake.CakeProjectSystem
    24.         Detecting Cake files in 'c:\Users\Jack\Documents\GitHub\Intellisense'.
    25. [info]: OmniSharp.Cake.CakeProjectSystem
    26.         Did not find any Cake files
    27. [info]: OmniSharp.MSBuild.ProjectSystem
    28.         Detecting projects in 'c:\Users\Jack\Documents\GitHub\Intellisense\Intellisense.sln'.
    29. [info]: OmniSharp.MSBuild.ProjectManager
    30.         Queue project update for 'c:\Users\Jack\Documents\GitHub\Intellisense\Assembly-CSharp.csproj'
    31. [info]: OmniSharp.Script.ScriptProjectSystem
    32.         Detecting CSX files in 'c:\Users\Jack\Documents\GitHub\Intellisense'.
    33. [info]: OmniSharp.Script.ScriptProjectSystem
    34.         Did not find any CSX files
    35. [info]: OmniSharp.WorkspaceInitializer
    36.         Configuration finished.
    37. [info]: OmniSharp.Stdio.Host
    38.         Omnisharp server running using Stdio at location 'c:\Users\Jack\Documents\GitHub\Intellisense' on host 16568.
    39. [info]: OmniSharp.MSBuild.ProjectManager
    40.         Loading project: c:\Users\Jack\Documents\GitHub\Intellisense\Assembly-CSharp.csproj
    41. [info]: OmniSharp.MSBuild.ProjectManager
    42.         Successfully loaded project file 'c:\Users\Jack\Documents\GitHub\Intellisense\Assembly-CSharp.csproj'.
    43. [info]: OmniSharp.MSBuild.ProjectManager
    44.         Adding project 'c:\Users\Jack\Documents\GitHub\Intellisense\Assembly-CSharp.csproj'
    45. [info]: OmniSharp.MSBuild.ProjectManager
    46.         Update project: Assembly-CSharp
    47. Received response for /completion but could not find request.
    48. Received response for /completion/resolve but could not find request.
    49. Received response for /completion/resolve but could not find request.
    50. Received response for /completion/resolve but could not find request.
    51. Received response for /completion/resolve but could not find request.
    52. [warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
    53.         No symbol found. File: c:\Users\Jack\Documents\GitHub\Intellisense\Assets\NewBehaviourScript.cs, Line: 12, Column: 9.
    54. [warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
    55.         No symbol found. File: c:\Users\Jack\Documents\GitHub\Intellisense\Assets\NewBehaviourScript.cs, Line: 7, Column: 17.
    56. Received response for /v2/getcodeactions but could not find request.
    57. [warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
    58.         No symbol found. File: c:\Users\Jack\Documents\GitHub\Intellisense\Assets\NewBehaviourScript.cs, Line: 13, Column: 9.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,674
    This may help you with intellisense and possibly other Visual Studio integration problems:

    Sometimes the fix is as simple as doing Assets -> Open C# Project from Unity. Other times it requires more.

    Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick.

    Barring all that, move on to other ideas:

    https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/

    Also, try update the VSCode package inside of Unity: Window -> Package Manager -> Search for Visual Studio Code Editor -> Press the Update button

    Also, this: https://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874
     
  3. jackt0310

    jackt0310

    Joined:
    Aug 2, 2020
    Posts:
    4
    Thanks for the response! I tried almost everything on this list and still no luck. The one that I haven't tried is the userprefs and .vsconfig files because I can't find where those are located. Also, it's possible I'm giving the wrong FrameworkPathOverride on that last link because I'm on Windows, but I've tried a couple of paths with that as well.
     
  4. SoLiDSoNiC

    SoLiDSoNiC

    Joined:
    Nov 19, 2019
    Posts:
    1
    "Also, try update the VSCode package inside of Unity: Window -> Package Manager -> Search for Visual Studio Code Editor -> Press the Update button"

    This worked for me thanks Kurt
     
    Kurt-Dekker likes this.
  5. harrylongman11

    harrylongman11

    Joined:
    Oct 27, 2020
    Posts:
    1
    Did you manage to fix this Jack. I've been having the same issue. Tried pretty much everything I've found online and no luck.


    Code (CSharp):
    1. Starting OmniSharp server at 25/10/2022, 20:38:46
    2.     Target: c:\Users\harry\OneDrive\Documents\Work\Gamedev\unity\Udemy - Project Boost\Udemy - Project Boost.sln
    3.  
    4. OmniSharp server started.
    5.     Path: c:\Users\harry\.vscode\extensions\ms-dotnettools.csharp-1.24.4-win32-x64\.omnisharp\1.38.2\OmniSharp.exe
    6.     PID: 9812
    7.  
    8. [info]: OmniSharp.Stdio.Host
    9.         Starting OmniSharp on Windows 6.2.9200.0 (x64)
    10. [info]: OmniSharp.Services.DotNetCliService
    11.         Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
    12. [info]: OmniSharp.Services.DotNetCliService
    13.         Using the 'dotnet' on the PATH.
    14. [info]: OmniSharp.Services.DotNetCliService
    15.         DotNetPath set to dotnet
    16. [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    17.         Located 3 MSBuild instance(s)
    18.             1: Visual Studio Community 2019 16.11.32929.386 16.11.2 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
    19.             2: Visual Studio Build Tools 2022 17.3.32929.385 17.3.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin"
    20.             3: StandAlone 17.1.1 - "c:\Users\harry\.vscode\extensions\ms-dotnettools.csharp-1.24.4-win32-x64\.omnisharp\1.38.2\.msbuild\Current\Bin"
    21. [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
    22.         Registered MSBuild instance: Visual Studio Build Tools 2022 17.3.32929.385 17.3.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin"
    23. [info]: OmniSharp.WorkspaceInitializer
    24.         Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
    25. [info]: OmniSharp.Cake.CakeProjectSystem
    26.         Detecting Cake files in 'c:\Users\harry\OneDrive\Documents\Work\Gamedev\unity\Udemy - Project Boost'.
    27. [info]: OmniSharp.Cake.CakeProjectSystem
    28.         Did not find any Cake files
    29. [info]: OmniSharp.MSBuild.ProjectSystem
    30.         Detecting projects in 'c:\Users\harry\OneDrive\Documents\Work\Gamedev\unity\Udemy - Project Boost\Udemy - Project Boost.sln'.
    31. [info]: OmniSharp.MSBuild.ProjectManager
    32.         Queue project update for 'c:\Users\harry\OneDrive\Documents\Work\Gamedev\unity\Udemy - Project Boost\Assembly-CSharp.csproj'
    33. [info]: OmniSharp.Script.ScriptProjectSystem
    34.         Detecting CSX files in 'c:\Users\harry\OneDrive\Documents\Work\Gamedev\unity\Udemy - Project Boost'.
    35. [info]: OmniSharp.Script.ScriptProjectSystem
    36.         Did not find any CSX files
    37. [info]: OmniSharp.WorkspaceInitializer
    38.         Configuration finished.
    39. [info]: OmniSharp.Stdio.Host
    40.         Omnisharp server running using Stdio at location 'c:\Users\harry\OneDrive\Documents\Work\Gamedev\unity\Udemy - Project Boost' on host 3968.
    41. [info]: OmniSharp.MSBuild.ProjectManager
    42.         Loading project: c:\Users\harry\OneDrive\Documents\Work\Gamedev\unity\Udemy - Project Boost\Assembly-CSharp.csproj
    43. [info]: OmniSharp.MSBuild.ProjectManager
    44.         Successfully loaded project file 'c:\Users\harry\OneDrive\Documents\Work\Gamedev\unity\Udemy - Project Boost\Assembly-CSharp.csproj'.
    45. [info]: OmniSharp.MSBuild.ProjectManager
    46.         Adding project 'c:\Users\harry\OneDrive\Documents\Work\Gamedev\unity\Udemy - Project Boost\Assembly-CSharp.csproj'
    47. [info]: OmniSharp.MSBuild.ProjectManager
    48.         Update project: Assembly-CSharp
    49. Received response for /v2/getcodeactions but could not find request.

    Can anyone point me in the right direction please?