OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.72k stars 169 forks source link

OmniSharp-vim not totaly compatible with the last versions of dotnet 2 #437

Closed JulioJu closed 5 years ago

JulioJu commented 5 years ago

Hi !

With omnisharp-roslyn 2881c46e2212b41aed22ee5ec1aafab99b6b6ecf (the last one commit the 12/11/2018), all warnings and some errors are not displayed. For instance, "Unecessary using directive" warning isn't displayed. More important, all errors of type The type or namespace 'xxx' could not be found are not raised.

Omnicompletion seems works, but just for few keywords, like System.<C-x><C-o>. For instance, CreateWebHostBuilder(args).Build().<C-x><C-o> display nothing.

Therefore, it seems than omnisharp-vim can't manage well with assemblies.

I've tested with dotnet 2.1.301 and dotnet 2.2.100, therefore it's maybe caused by the fact than omnisharp-vim should be updated ?

@nickspoons what do you think about that ?

Thanks in advance

nickspoons commented 5 years ago

@JulioJu it sounds to me like omnisharp-roslyn isn't loading properly, or is dealing with conflicting frameworks. I wonder if this could be related to how you are building omnisharp-roslyn? Your PR https://github.com/OmniSharp/omnisharp-roslyn/pull/1361 no longer removes DLLs with this comment: Delete assemblies that are included in our Mono package. So perhaps there's now a conflict between the dotnet you have installed, and the mono DLLs in your omnisharp-roslyn?

I don't know, hopefully the omnisharp-roslyn guys will be able to give some feedback on your PR.

From our end, all we can do is use the endpoints and responses we get from omnisharp-roslyn. As far as I know there are no new endpoints, and they are very careful not to introduce breaking changes. If you think that omnisharp-roslyn may be returning results that omnisharp-vim isn't using, you can check the body of the /codecheck endpoint. Add this to your .vimrc:

let g:OmniSharp_proc_debug = 1
let g:OmniSharp_loglevel = 'debug'

And run :OmniSharpOpenPythonLog to see the debug logs. Each request/response has 4 lines, find a /codecheck response and see if there is anything in there that omnisharp-vim isn't reporting.

nickspoons commented 5 years ago

@JulioJu I've tried the steps from your PR, making a local build and coping the removed assemblies to the artifacts/publish/OmniSharp.Http.Driver/net461 directory, and pointing my vim at the OmniSharp.exe there with:

let g:OmniSharp_server_path = '/home/nickspoon/code/omnisharp-roslyn/artifacts/publish/OmniSharp.Http.Driver/mono/OmniSharp.exe'
let g:OmniSharp_server_use_mono = 1

With this I can get full OmniSharp support in vim in a simple dotnet project, including System.<C-x><C-o> to complete to System.Console.<C-x><C-o> to complete to System.Console.WriteLine etc.

So great work on find that omnisharp-roslyn issue! But I can't recreate the issues you're seeing in OmniSharp-vim.

JulioJu commented 5 years ago

@nickspoons I've tested with your build that you has sent me by email 9b5e3ebb

Even with a totally new project created with the command

$ mkdir Aspnet && cd Aspnet && dotnet new web && dotnet new sln && dotnet sln add Aspnet.csproj

In Program.cs, when I type CreateWebHostBuilder(args).Build().<C-x><C-o> nothing work. And we could see that contrary to the old official release 1.32.5 1.32.1, warnings like Unnecessary using directive are not displayed.

Have you this same issue with 9b5e3ebb (sent by email) ?

As I've explained, I've an other issue. I can compile only the last version of december, but not older. I've tried several times, I don't understand. Have you the same issue with an updated version of Arch Linux ? If I can't compile older versions, I can't try to understand.

JulioJu commented 5 years ago

We can't compile if we are not at the head of an branch! Simply type git checkout -b myNewBranch it it works. So strange.

JulioJu commented 5 years ago

In my Arch Linux,

  1. With https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v1.32.5/omnisharp.http-linux-x64.tar.gz uncompress in ~/.omnisharp/omnisharp-roslyn

  2. With ~/.omnisharp/omnisharp-roslyn/omnisharp replaced by the folder

But with the same omnisharp-roslyn 3.2.5 compiled with dotnet version 2.1.103 (omnisharp-roslyn could be only compiled with this version of dotnet) + a runtime of dotnet 2.2.100 (in the environment variable), it works, but not fully : with limitations described in commits above.

I'm continuing to investigate

JulioJu commented 5 years ago

Same problem when I test with version 3.2.8 (the last release of omnisharp-roslyn). Therfore the problem is with dotnet 2.2.100 and not other. Actually Omnisharp is not fully compatible with the last one version of dotnet

JulioJu commented 5 years ago

Close as it's duplicate with https://github.com/OmniSharp/omnisharp-vim/issues/427 . But now we know that the problem is compatibility between omnisharp-roslyn and the last one version of dotnet.