OmniSharp / omnisharp-emacs

Troll coworkers - use Emacs at work for csharp!
GNU General Public License v3.0
512 stars 94 forks source link

emacs does not autocomplete for unity3d types #506

Closed ghost closed 4 years ago

ghost commented 4 years ago

OS: LINUX

Hi guys, im faceing an issue that when i open C# file form new unity3d Project and trying to type :

GetC

excpected: GetComponent result: nothing

Log:

[13:58:34] starting server on project root "/home/tj/Documents/Unity3d/New Unity Project/"
[13:58:34] Using server binary on /home/tj/.emacs.d/.cache/omnisharp/server/v1.34.5/run
[13:58:34] INFORMATION: OmniSharp.Stdio.Host, Starting OmniSharp on kali 2020.2 (x64)
[13:58:34] INFORMATION: OmniSharp.Services.DotNetCliService, DotNetPath set to dotnet
[13:58:34] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Located 1 MSBuild instance(s)
            1: StandAlone 16.0 - "/home/tj/.emacs.d/.cache/omnisharp/server/v1.34.5/omnisharp/.msbuild/Current/Bin"
[13:58:34] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, MSBUILD_EXE_PATH environment variable set to '/home/tj/.emacs.d/.cache/omnisharp/server/v1.34.5/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[13:58:34] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Registered MSBuild instance: StandAlone 16.0 - "/home/tj/.emacs.d/.cache/omnisharp/server/v1.34.5/omnisharp/.msbuild/Current/Bin"
            MSBuildExtensionsPath = /usr/lib/mono/xbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = /home/tj/.emacs.d/.cache/omnisharp/server/v1.34.5/omnisharp/.msbuild/Current/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /home/tj/.emacs.d/.cache/omnisharp/server/v1.34.5/omnisharp/.msbuild/Current/Bin
            TargetFrameworkRootPath = /usr/lib/mono/xbuild-frameworks
[13:58:35] INFORMATION: OmniSharp.Cake.CakeProjectSystem, Detecting Cake files in '/home/tj/Documents/Unity3d/New Unity Project'.
[13:58:35] INFORMATION: OmniSharp.Cake.CakeProjectSystem, Could not find any Cake files
[13:58:35] INFORMATION: OmniSharp.MSBuild.ProjectSystem, No solution files found in '/home/tj/Documents/Unity3d/New Unity Project'
[13:58:35] INFORMATION: OmniSharp.Script.ScriptProjectSystem, Detecting CSX files in '/home/tj/Documents/Unity3d/New Unity Project'.
[13:58:35] INFORMATION: OmniSharp.Script.ScriptProjectSystem, Could not find any CSX files
[13:58:35] INFORMATION: OmniSharp.WorkspaceInitializer, Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[13:58:35] INFORMATION: OmniSharp.WorkspaceInitializer, Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[13:58:35] INFORMATION: OmniSharp.WorkspaceInitializer, Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
[13:58:35] INFORMATION: OmniSharp.WorkspaceInitializer, Configuration finished.
[13:58:35] INFORMATION: OmniSharp.Stdio.Host, Omnisharp server running using Stdio at location '/home/tj/Documents/Unity3d/New Unity Project' on host -1.
[13:58:38] INFORMATION: OmniSharp.OmniSharpWorkspace, Miscellaneous file: /home/tj/Documents/Unity3d/New Unity Project/Assets/NewBehaviourScript.cs added to workspace`

I noticed this line: [13:58:35] INFORMATION: OmniSharp.MSBuild.ProjectSystem, No solution files found in '/home/tj/Documents/Unity3d/New Unity Project'``

now, my question ,,, how can i generate solution file for my project to make unity3d types works ?

is there any automatically way to create that file without VS code ??

Sorry for opening this issue , and i hope to find an answer

thanks in advance <3

ghost commented 4 years ago

So, I did a work around ,

i installed Monodevelop and then followed this steps:

1 - Edit -> Prefences -> External Tools 2 - Set the external script editor to monodevelop 3 - open any C# file in Project, or go to Assets -> Open C# Project , now the .sln and .csproj files created successfully 4 - close mono (I dont use it anyway) 5 - start omnisharp in emacs

Done , auto complete working !

Im still want a way to create these files without any of monodevelop and VS code

ty

ghost commented 3 years ago

Or you can check the box -> Generate all .cproj files (from prefences), then Assets -> Open C# project

Screenshot_2020-08-19_00-21-08

R0flcopt3r commented 3 years ago

I can't seem to get this to work... It seems to have generated the csproj files, as there are tons of them in my project.

*omnisharp-log* isn't providing any information either..

mlp1802 commented 2 years ago

iDevTJ solution worked for me