sublimelsp / LSP-OmniSharp

Convenience plugin to install/update OmniSharp for LSP
MIT License
20 stars 9 forks source link

Unity 2020.3.25 projects fails to find project files #12

Open genericptr opened 2 years ago

genericptr commented 2 years ago

When I upgraded Unity my project files ceased to load in LSP-Omnisharp.

In VSCode the project still loads properly and this is probably due to the dated version of Omnisharp server being used. Suggestion is to upgrade to 1.38.0 like VSCode uses.

Starting OmniSharp server at 2/17/2022, 9:27:45 AM
    Target: /Users/Shared/Unity_Roger/Thera_Practice/Thera_Practice.sln

OmniSharp server started with Mono 6.12.0.
    Path: /Users/ryanjoseph/.vscode/extensions/ms-dotnettools.csharp-1.24.0/.omnisharp/1.38.0/omnisharp/OmniSharp.exe
    PID: 42289
rwols commented 2 years ago

I think this is because we use the bundled mono while we should point omnisharp to use the mono from Unity.

genericptr commented 2 years ago

Here's the full output from VSCode. It looks like it may be using mono 6.12.0 from a system framework outside of VSCode. What version is ST using?

Starting OmniSharp server at 2/28/2022, 1:50:55 PM
    Target: /Users/Shared/Unity_Roger/Thera_Practice/Thera_Practice.sln

OmniSharp server started with Mono 6.12.0.
    Path: /Users/ryanjoseph/.vscode/extensions/ms-dotnettools.csharp-1.24.0/.omnisharp/1.38.0/omnisharp/OmniSharp.exe
    PID: 35246

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 12.2 (x64)
[info]: OmniSharp.Services.DotNetCliService
        Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
        Using the 'dotnet' on the PATH.
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Mono 16.6.0 - "/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin"
            2: StandAlone 17.0.0 - "/Users/ryanjoseph/.vscode/extensions/ms-dotnettools.csharp-1.24.0/.omnisharp/1.38.0/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 16.6.0 - "/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin"
            CscToolExe = csc.exe
            CscToolPath = /Users/ryanjoseph/.vscode/extensions/ms-dotnettools.csharp-1.24.0/.omnisharp/1.38.0/omnisharp/.msbuild/Current/Bin/Roslyn
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[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.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/Shared/Unity_Roger/Thera_Practice'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Did not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/Users/Shared/Unity_Roger/Thera_Practice/Thera_Practice.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/Shared/Unity_Roger/Thera_Practice/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/Shared/Unity_Roger/Thera_Practice/Assembly-CSharp-Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/Shared/Unity_Roger/Thera_Practice'.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/Shared/Unity_Roger/Thera_Practice/Assembly-CSharp.csproj
[info]: OmniSharp.Script.ScriptProjectSystem
        Did not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/Users/Shared/Unity_Roger/Thera_Practice' on host 35203.
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/Shared/Unity_Roger/Thera_Practice/Assembly-CSharp.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/Shared/Unity_Roger/Thera_Practice/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/Shared/Unity_Roger/Thera_Practice/Assembly-CSharp-Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/Shared/Unity_Roger/Thera_Practice/Assembly-CSharp-Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/Shared/Unity_Roger/Thera_Practice/Assembly-CSharp-Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Assembly-CSharp
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Assembly-CSharp-Editor
Received response for /findusages but could not find request.
igorr0driguez commented 2 years ago

Has anyone been able to make any progress in this? I've tried reassingning "FrameworkPathOverride" to point to my 6.12 Mono install but apparently had no success, still the same issues.

Has msbuild and mono in PATH but still a no.

How can we point the bundled OmniSharp to correctly point to a globally installed Mono?

In this issue: https://github.com/OmniSharp/omnisharp-roslyn/issues/1948

Some Mac and Linux users were able to solve this by doing that.

jrobertson98atx commented 10 months ago

I have a version of LSP-OmniSharp that seems to be working with Unity on Mac. Part of that is specifying the mono binary location explicitly as a setting. Let me know if there's interest in getting this into the main repo.

deathaxe commented 1 month ago

Should be fixed by PR https://github.com/sublimelsp/LSP-OmniSharp/pull/40, which makes transition to latest .NET 6+ based OmniSharp binaries.