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

Is OmniSharp outdated? #3324

Closed
trbjo opened this issue Feb 17, 2019 · 11 comments
Closed

Is OmniSharp outdated? #3324

trbjo opened this issue Feb 17, 2019 · 11 comments

Comments

@trbjo
Copy link

trbjo commented Feb 17, 2019

First of all, YCM is a really nice tool, and I like it a lot!

I have however noticed that the OmniSharp completion seems to be out of date (Yes, I use the newest version). A few examples:

This is omnisharp-vim with Ale used as a linter:
screenshot_2019-02-17-132515
It correctly captures that I can't use f.CountToTen. Now YCM installed via ./install-py --cs-completer:
screenshot_2019-02-17-132723

Another example. This is again vim-omnisharp + ale:
screenshot_2019-02-17-132935

And now YCM:
screenshot_2019-02-17-132846
This is a false positive since this feature has been in C# since 2017.

It seems to me that the version of OmniSharp that YCM uses is quite old. The project linked to in the README's last update is from 2015. Is there any possibility to update to use the newer sources used by omnisharp-vim or at least a way to compile it myself with the newer source enabled?

@bstaletic
Copy link
Collaborator

From the omnisharp-vim README:

The plugin relies on the OmniSharp-Roslyn server

This isn't the same as OmniSharp that YCM uses. Roslyn is newer and the legacy one, used by YCM, isn't supported any more.

The ycmd repo has this issue open: ycm-core/ycmd#1082
In short, the C# completer is outdated, but the blocker for migration to Roslyn is lack of FixIts.

@trbjo
Copy link
Author

trbjo commented Feb 17, 2019

Thank you for your answer. I will close this now.

@trbjo trbjo closed this as completed Feb 17, 2019
@bstaletic
Copy link
Collaborator

You can pull in the latest legacy OmniSharp completer by going into YouCompleteMe/third_party/ycmd/third_party/OmniSharp and pulling in the latest changes to the server. No idea how that would work out, so if you do this and it solves some problems report back to us.

You can also check out ycm-core/ycmd#885.

@trbjo
Copy link
Author

trbjo commented Feb 17, 2019

I can't even build it. (I am NOT very good at git). I did:
~ $ cd .local/share/nvim/plugged/YouCompleteMe/third_party/ycmd
git fetch origin pull/885/head:roslyn
git checkout roslyn
git submodule update --init --recursive

and then ./build.py --cs-completer or ./install.py --cs-completer from the main dir of YCM gives me:

/home/tb/.local/share/nvim/plugged/YouCompleteMe/third_party/ycmd/cpp/BoostParts/libs/python/src/converter/builtin_converters.cpp:51:35: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0;
^
[15/67] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/dict.cpp.o
ninja: build stopped: subcommand failed.
ERROR: the build failed.

@bstaletic
Copy link
Collaborator

That file hasn't been part of our codebase for a very long time now. You need to update YCM's submodules. In the YCM directory run git submodule update --recursive. Also, for support like this hop over to gitter.

@insidewhy
Copy link

insidewhy commented Mar 13, 2019

In short, the C# completer is outdated, but the blocker for migration to Roslyn is lack of FixIts.

By only supporting C# versions that are several years old you are essentially taking C# away from the vast majority of users of YouCompleteMe so the pragmatic way forwards seem to be to just disable fixits for C#.

@puremourning
Copy link
Member

PRs welcome I suppose. None of the core YCM developers use c# regularly, so there's little impetus for us to change.

When I do use OmniSharp at work for projects, it works fine for me.

@insidewhy
Copy link

@puremourning There was a PR though, but it was rejected because fixits are not supported. I'd have made a PR for this months ago if that were not the case.

Shame your work projects are using such an old version of C#, the later versions provide some really nice stuff.

@micbou
Copy link
Collaborator

micbou commented Mar 13, 2019

There was a PR though, but it was rejected because fixits are not supported.

No, it was rejected for all reasons given in ycm-core/ycmd#1082.

@insidewhy
Copy link

@micbou Those comments were all either address or easily addressable, if you look further down the thread you just linked:

"Apart from us not wanting to support two backends, this [fixits] is the only concern left."

Fixits are also noted as being the reason for the outdated C# in a number of other threads.

If the maintainers of this repo are willing to accept that fixits are an acceptable casualty (at least temporarily) to allow support for a recent version of C# then I'll get that PR back in shape.

@insidewhy
Copy link

Also:

"The problem with Roslyn is that it doesn't support FixIts and that's one of the blockers."

"I suppose we need to wait for PR OmniSharp/omnisharp-roslyn#1076 then" (a PR to introduce fixits)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants