Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omnsharp doesn't works in WSL #709

Closed
Johan-Palacios opened this issue Jul 9, 2021 · 8 comments
Closed

Omnsharp doesn't works in WSL #709

Johan-Palacios opened this issue Jul 9, 2021 · 8 comments

Comments

@Johan-Palacios
Copy link

I installed Omnisharp vim in my Ubuntu in WSL, and this plugin doesn't work, I tried to reinstall the plugin and activate other options, but it not works, can you give me a solution?

@nickspoons
Copy link
Member

WSL2? It currently doesn't look like OmniSharp-vim and talk to the OmniSharp-roslyn server in WSL2, see issue #706: Omnisharp-vim not doing anything on WSL2

@nickspoons
Copy link
Member

You've given no details of what the problem is. I don't know if you are trying to use a Windows server or just code Linux dotnet projects in WSL. Please share your config and log and give enough information to understand your issue.

@Johan-Palacios
Copy link
Author

Johan-Palacios commented Jul 12, 2021

This is my log

NVIM v0.5.0-dev

OmniSharp server started.
    Path: /home/johan_linux/.cache/omnisharp-vim/omnisharp-roslyn/run
    Target: /mnt/c/Users/ByGoh/Workspace/03_C#/IntroC#
    PID: 3335

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on ubuntu 20.4 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 17.0.0 - "/home/johan_linux/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/home/johan_linux/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 17.0.0 - "/home/johan_linux/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin"
            CscToolExe = csc.exe
            MSBuildToolsPath = /home/johan_linux/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin
            CscToolPath = /home/johan_linux/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild/Current/Bin/Roslyn
            BypassFrameworkInstallChecks = true
            MSBuildExtensionsPath = /home/johan_linux/.cache/omnisharp-vim/omnisharp-roslyn/omnisharp/.msbuild
[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 '/mnt/c/Users/ByGoh/Workspace/03_C#/IntroC#'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in '/mnt/c/Users/ByGoh/Workspace/03_C#/IntroC#'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/mnt/c/Users/ByGoh/Workspace/03_C#/IntroC#'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/mnt/c/Users/ByGoh/Workspace/03_C#/IntroC#' on host -1.
Workspace complete: no projects
All projects loaded
Replaying on-load requests
[info]: OmniSharp.OmniSharpWorkspace
        Miscellaneous file: /mnt/c/Users/ByGoh/Workspace/03_C#/IntroC#/Helloworld.cs added to workspace
Replaying requests for buffer 1

@nickspoons
Copy link
Member

OK, so you're working on raw .cs files (no .csproj or .sln) on the Windows filesystem, from WSL.

Is this WSL1 or WSL2? You can check by running wsl.exe --list -v

@Johan-Palacios
Copy link
Author

Johan-Palacios commented Jul 12, 2021

This is the return :
NAME STATE VERSION
Ubuntu Running 1

It's WSL 1

@nickspoons
Copy link
Member

And what is not working? If you add this to your .cs file and put the cursor on the 2nd line, does :OmniSharpGotoDefinition move the cursor to the first line?

void CallMe() {
    System.Console.WriteLine("Called");
}
CallMe();

@Johan-Palacios
Copy link
Author

The autosuggestions isn't works ._. but the other funcions works well

And the OmniSharpGotoDefinition works well

@nickspoons
Copy link
Member

OmniSharp-vim doesn't provide autocompletion. It provides completions which can be triggered manually with <C-x><C-o>, or you can use an autocompletion plugin to trigger them as you type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants