omnisharp-vim icon indicating copy to clipboard operation
omnisharp-vim copied to clipboard

Using UnityEngine.** is Error

Open DuGlaser opened this issue 5 years ago • 12 comments

using UnityEngin.UI 

If you write something like UnityEngin.** as above, you'll get the following error.

The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing
 an assembly reference?)

I also checked the log and found the following warning.

        Unable to resolve assembly '/Users/~~/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/~~/Temp/bin/Debug/UnityEngine.UI.dll'

I've tried the following

  1. Reinstall omnisharp-vim using dein
  2. rm -rf ~/.omnisharp ~/.cache/omnisharp-vim
  3. Reinstall omn​​isharp-roslyn v1.35.2(I've tried the latest version too.)

I've investigated and this bug seems to have occurred after https://github.com/OmniSharp/omnisharp-vim/commit/787213ff92e276ece530884b7c2a2dc3275aaf7b.

My environment

  • MacOS 10.15.5 (x64)
  • NVIM v0.4.3
[[plugins]]
repo = "OmniSharp/omnisharp-vim"
on_ft = ["cs"]
build = "xbuild server/OmniSharp.sln"
hook_add = '''
let g:OmniSharp_server_stdio = 1
autocmd FileType cs nnoremap gd :OmniSharpGotoDefinition<cr>
autocmd FileType cs nnoremap <C-m><c-n> :OmniSharpRename<cr>
autocmd FileType cs nnoremap <C-m><C-f> :OmniSharpCodeFormat<cr>
'''

DuGlaser avatar Jul 07 '20 09:07 DuGlaser

Thanks for narrowing this down to a specific commit.

Would you be able to post logs before and after that commit? I've been trying to tighten our omnisharp-roslyn integration and send requests at the correct time, but I haven't seen an error like that before.

nickspoons avatar Jul 07 '20 10:07 nickspoons

Logging with :OmniSharpOpenLog in e6b30f572f87dc9144ddc5def14f3537af1e89c3

NVIM v0.4.3

OmniSharp server started.
    Path: /Users/username/.cache/omnisharp-vim/omnisharp-roslyn/run
    Target: /Users/project_path/BrackOut2.sln
    PID: 3106

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.15.5 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 16.4 - "/Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 16.4 - "/Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin"
            CscToolExe = csc.exe
            MSBuildToolsPath = /Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin
            CscToolPath = /Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin/Roslyn
            BypassFrameworkInstallChecks = true
            MSBuildExtensionsPath = /Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/project_path'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/Users/project_path/BrackOut2.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/UnityEngine.TestRunner.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/UnityEngine.UI.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.TextMeshPro.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.Timeline.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.TextMeshPro.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.Timeline.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/UnityEditor.TestRunner.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/UnityEditor.UI.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.Rider.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.CollabProxy.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.VSCode.Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/project_path'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/UnityEngine.TestRunner.csproj
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/Users/project_path' on host -1.
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/UnityEngine.TestRunner.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/UnityEngine.TestRunner.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/UnityEngine.UI.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/UnityEngine.UI.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/UnityEngine.UI.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.TextMeshPro.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.TextMeshPro.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.TextMeshPro.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.Timeline.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.Timeline.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.Timeline.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Assembly-CSharp.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Assembly-CSharp.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.TextMeshPro.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.TextMeshPro.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.TextMeshPro.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.Timeline.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.Timeline.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.Timeline.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/UnityEditor.TestRunner.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/UnityEditor.TestRunner.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/UnityEditor.TestRunner.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/UnityEditor.UI.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/UnityEditor.UI.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/UnityEditor.UI.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.Rider.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.Rider.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.Rider.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.CollabProxy.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.CollabProxy.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.CollabProxy.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.VSCode.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.VSCode.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.VSCode.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UnityEngine.TestRunner
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UnityEngine.UI
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.TextMeshPro
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.Timeline
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Assembly-CSharp
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.CollabProxy.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.Rider.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.TextMeshPro.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.TextMeshPro.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.Timeline.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.Timeline.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.VSCode.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.TextMeshPro.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.TextMeshPro.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.Timeline.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.Timeline.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UnityEditor.TestRunner
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UnityEditor.UI
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.Rider.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.CollabProxy.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.VSCode.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
Workspace complete: 12 project(s)
Replaying requests

DuGlaser avatar Jul 07 '20 10:07 DuGlaser

Logging with :OmniSharpOpenLog in 787213ff92e276ece530884b7c2a2dc3275aaf7b (Buggy version)

NVIM v0.4.3

OmniSharp server started.
    Path: /Users/username/.cache/omnisharp-vim/omnisharp-roslyn/run
    Target: /Users/project_path/BrackOut2.sln
    PID: 10603

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.15.5 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 16.4 - "/Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 16.4 - "/Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin"
            CscToolExe = csc.exe
            MSBuildToolsPath = /Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin
            CscToolPath = /Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin/Roslyn
            BypassFrameworkInstallChecks = true
            MSBuildExtensionsPath = /Users/username/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/project_path'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/Users/project_path/BrackOut2.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/UnityEngine.TestRunner.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/UnityEngine.UI.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.TextMeshPro.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.Timeline.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.TextMeshPro.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.Timeline.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/UnityEditor.TestRunner.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/UnityEditor.UI.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.Rider.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.CollabProxy.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/project_path/Unity.VSCode.Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/project_path'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/UnityEngine.TestRunner.csproj
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/Users/project_path' on host -1.
[info]: OmniSharp.OmniSharpWorkspace
        Miscellaneous file: /Users/project_path/Assets/Scripts/BallController.cs added to workspace
Replaying requests for buffer 1
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/UnityEngine.TestRunner.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/UnityEngine.TestRunner.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/UnityEngine.UI.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/UnityEngine.UI.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/UnityEngine.UI.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.TextMeshPro.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.TextMeshPro.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.TextMeshPro.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.Timeline.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.Timeline.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.Timeline.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Assembly-CSharp.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Assembly-CSharp.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.TextMeshPro.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.TextMeshPro.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.TextMeshPro.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.Timeline.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.Timeline.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.Timeline.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/UnityEditor.TestRunner.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/UnityEditor.TestRunner.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/UnityEditor.TestRunner.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/UnityEditor.UI.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/UnityEditor.UI.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/UnityEditor.UI.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.Rider.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.Rider.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.Rider.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.CollabProxy.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.CollabProxy.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.CollabProxy.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/project_path/Unity.VSCode.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/project_path/Unity.VSCode.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/project_path/Unity.VSCode.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UnityEngine.TestRunner
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UnityEngine.UI
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.TextMeshPro
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.Timeline
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Assembly-CSharp
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.CollabProxy.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.Rider.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.TextMeshPro.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.TextMeshPro.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.Timeline.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.Timeline.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.VSCode.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.TextMeshPro.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.TextMeshPro.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.Timeline.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/Unity.Timeline.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UnityEditor.TestRunner
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UnityEditor.UI
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.Rider.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.CollabProxy.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Unity.VSCode.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.TestRunner.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/project_path/Temp/bin/Debug/UnityEngine.UI.dll'
Workspace complete: 12 project(s)

DuGlaser avatar Jul 07 '20 10:07 DuGlaser

Thanks. Those 2 logs are very similar - are you saying that you don't get the The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' errors when using the first commit, but you do when using the 2nd?

Do the /Users/project_path/Temp/bin/Debug/UnityEditor.UI.dll files which are warned as "Unable to resolve" actually exist? From all those errors it seems like the server is just not loading - but you used to have working omnisharp-vim support in this repo?

nickspoons avatar Jul 07 '20 11:07 nickspoons

I've found a couple of pages which seem to suggest this is a known Unity bug:

https://forum.unity.com/threads/visual-studio-code-editor-1-1-4-error-the-referenced-project-does-not-exist.806628/ https://forum.unity.com/threads/namespace-name-ui-does-not-exist-in-the-namespace-unityengine-error-on-2019-3-2f1.831922/

Please let me know if this is just a Unity thing, or if other versions of OmniSharp-vim are able to work with this project.

nickspoons avatar Jul 07 '20 11:07 nickspoons

/Users/project_path/Temp/bin/Debug/ UnityEditor.UI.dll does not actually exist. However, it works fine in versions prior to e6b30f5, and : OmniSharpGotoDefinition and others also worked.

DuGlaser avatar Jul 07 '20 11:07 DuGlaser

Now I'm getting confused.

However, it works fine in versions prior to e6b30f5,

Does e6b30f5 work properly? Or just versions before that?

Could you try adding this to your .vimrc, and post the log from the last working version, and then the log from the current master? These will be quite big, it might be a good idea to use a pastebin:

let g:OmniSharp_loglevel = 'debug'

This will include the raw requests and responses to/from the server in the log, as well as extra debugging info from OmniSharp-roslyn. So please perform a :OmniSharpGotoDefinition in each session, so we can compare the outputs in the logs.

nickspoons avatar Jul 07 '20 11:07 nickspoons

https://gist.github.com/DuGlaser/2789d2e6020e85638f5830acf0210a2b https://gist.github.com/DuGlaser/1bbea99433ceceebd092da5a3907c0e0

These will be the logs. In fact, if you try to jump to the Text class of UnityEngin.UI in the latest version, you'll see "Not Found" message. The e6b30f5 version allows you to jump normally.

DuGlaser avatar Jul 07 '20 12:07 DuGlaser

Thanks so much for the logs, very helpful.

The only real difference here is the timing of when we send requests to the server. In 787213f I changed the system to make some requests much earlier - in the various environments I've tested in this has worked well but clearly not in this one.

I don't have any Unity experience - is there any kind of sample repo I can pull to reproduce this locally? Or do I need to install Unity and have it generate projects for me?? Without being able to reproduce, all I can do is guess.

nickspoons avatar Jul 07 '20 12:07 nickspoons

I've created a sample repository. Try it here!

https://github.com/DuGlaser/sample-bug-unity

If you have any questions, please let me know!

DuGlaser avatar Jul 08 '20 01:07 DuGlaser

That's awesome, thank you!

I can repro in Windows, after installing unity, and setting the preferences as you described.

nickspoons avatar Jul 08 '20 04:07 nickspoons

Also running into this issue using the Windows Linux subsystem. Also when I try to import UnityEngine it also indicates an Unneccessary using directive . So don't know if this is related.

xibz avatar Mar 01 '21 00:03 xibz

After trying the sample project provided by @DuGlaser again, in both Windows and linux, I can no longer reproduce the issue. It looks to me like either OmniSharp-vim improvements or OmniSharp-roslyn improvements or a combination have resolved the issue, so I will close this.

nickspoons avatar Jun 27 '23 01:06 nickspoons