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

Omnisharp roslyn #213

Closed
wants to merge 2 commits into from
Closed

Conversation

mispencer
Copy link
Contributor

Allow using omnisharp-roslyn. See #209 (comment).

Omnisharp-roslyn tests do not currently pass on my system, and I'm still receiving a path too long error. Once it is built, it seems to work, though it seems slow.

This pull request does not make roslyn the default (yet). Rather, it must be switched to the roslyn implementation by running the UseRoslynOmnisharp completer subcommand. This is per-solution, and pre-runtime.

Review on Reviewable

@vheon
Copy link
Contributor

vheon commented Sep 1, 2015

Why the double backend? According to @nosami omnisharp-roslyn should be better then the one we use currently, am I missing something?

@micbou
Copy link
Collaborator

micbou commented Sep 1, 2015

I tried it and it is not really usable in its current state. There are too much completion timeouts. Maybe we are doing something wrong.

@mispencer
Copy link
Contributor Author

Yes, that's my experience too. Maybe it would be faster with the new stdio protocol, but that would be a considerable implementation effort.

The legacy omnisharp doesn't work on new-style projects, which is a use case for using this new roslyn omnisharp backend. But in general, the performance is not (yet?) there to use exclusively.

@nosami Are we doing something wrong here?

@nosami
Copy link

nosami commented Sep 2, 2015

In my experience, it's marginally faster than the old server.

Are you fetching documentation on each request? That is known to be slow. There is caching on the server to make subsequent requests faster.

@mispencer
Copy link
Contributor Author

I'm making the exact same request. WantDocumentationForEveryCompletionResult set to true, and ForceSemanticCompletion and WantImportableTypes set to false. Maybe it's because omnisharp-roslyn doesn't seem to support either ForceSemanticCompletion or WantImportableTypes?

@nosami
Copy link

nosami commented Sep 2, 2015

ForceSemanticCompletion must be a purely ycm thing. OmniSharp always returns semantic completions.
WantImportableTypes hasn't yet been implemented.

Try WantDocumentationForEveryCompletionResult set to false. This is a huge time sink.

@mispencer
Copy link
Contributor Author

ForceSemanticCompletion was implemented in OmniSharp/omnisharp-server#196.

@nosami
Copy link

nosami commented Sep 2, 2015

Ah I see. I was thinking of something else sorry.

In that case the server will act as if that flag was set to true.

@Valloric
Copy link
Member

Valloric commented Sep 2, 2015

Thanks for sending out the PR!

I'd rather wait until we can fully switch over to omnisharp-roslyn than have a switchable implementation.

@homu
Copy link
Contributor

homu commented Sep 19, 2015

☔ The latest upstream changes (presumably #226) made this pull request unmergeable. Please resolve the merge conflicts.

@mispencer
Copy link
Contributor Author

Yay, green checkmark from Travis. I assume I can ignore the AppVeyor failure.

Ok, so I gross violated the rule of small pull requests. Justification: Travis is a jerk

To achieve good performance, we need to use the stdio interface of omnisharp-roslyn. This vastly complicated the C# completer. Additionally, roslyn did not play nicely with the legacy Travis, which necessitated switching to the new Travis infrastructure.

Regarding the switchable implementation, as you can see by all the tests I skipped while under it, omnisharp-roslyn is still not a feature complete replacement for OmnisharpServer. Yet, OmnisharpServer doesn't work on the new json-based C# project. So, where possible, I would prefer to use OmnisharpServer, but I still need omnisharp-roslyn available for new projects.

self._logger.info( "Omnisharp "+type+": " + line.rstrip() )
except Exception:
self._logger.error( "Read error: " + traceback.format_exc() )
#self._logger.info( "Log " + type + " Out done" )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably left this by accident.

@Valloric
Copy link
Member

I assume I can ignore the AppVeyor failure.

Yes, the breakage is expected, not everything is fully set up for it.

Ok, so I gross violated the rule of small pull requests.

Oh boy, did you ever. :)

I'm going to need help reviewing this monster. @vheon @micbou @puremourning

Regarding the switchable implementation, as you can see by all the tests I skipped while under it, omnisharp-roslyn is still not a feature complete replacement for OmnisharpServer. Yet, OmnisharpServer doesn't work on the new json-based C# project. So, where possible, I would prefer to use OmnisharpServer, but I still need omnisharp-roslyn available for new projects.

I think the switchable implementation might be ok if it's temporary. If work is happening upstream in Omnisharpland to get to feature parity and we might get there within 6 months to a year at most, then maybe. But I don't want to continue supporting both configurations. Also, we should now or some time soon declare (in the docs) the legacy Omnisharp support deprecated and on the way out.

I'm interested in what the rest of the YCM crew think of this.

@homu
Copy link
Contributor

homu commented Sep 21, 2015

☔ The latest upstream changes (presumably #232) made this pull request unmergeable. Please resolve the merge conflicts.

@vheon
Copy link
Contributor

vheon commented Sep 21, 2015

which necessitated switching to the new Travis infrastructure.

Did it worked? Isn't necessary to ask Travis to abilitate the repo for the new infrastructure? @Valloric did you ask for it in preparation for OSX testing?

omnisharp-roslyn is still not a feature complete replacement for OmnisharpServer. Yet, OmnisharpServer doesn't work on the new json-based C# project. So, where possible, I would prefer to use OmnisharpServer, but I still need omnisharp-roslyn available for new projects.

How many feature are missing? maybe @nosami could shed some light on the roadmap for them or tell us if we're doing something wrong.

@@ -215,7 +236,10 @@ def OnUserCommand( self, arguments, request_data ):
raise ValueError( self.UserCommandsHelpMessage() )

command = arguments[ 0 ]
if command in CsharpSolutionCompleter.subcommands:
del arguments[ 0 ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use command = arguments.pop( 0 )?

@nosami
Copy link

nosami commented Sep 21, 2015

Roslyn is implementing a public intellisense API that should be ready any time now. It will be the exact same API that is used by Visual Studio.

Currently, we are using the Roslyn Recommender API which isn't as fully featured yet as either VS or the older NRefactory API.

Like I said earlier though, fetching documentation for every single item in the completion list is always going to be slow on the first hit - there can be multiple sources for docs. It's much faster to fetch docs for an individual item on demand .. although you're probably constrained by the way that Vim does completion.

@vheon
Copy link
Contributor

vheon commented Sep 21, 2015

Roslyn is implementing a public intellisense API that should be ready any time now.

@nosami so the API is going to change from the current one? If so we should wait...

@nosami
Copy link

nosami commented Sep 21, 2015

@vheon The OmniSharp API won't change, but the Roslyn API underneath it will.

edit - The OmniSharp API is almost the same now with the Roslyn engine as the old NRefactory powered version (omnisharp-server). We try very hard not to break existing consumers.

@vheon
Copy link
Contributor

vheon commented Sep 21, 2015

@nosami ok thanks. At this point though, if the roslyn work

should be ready any time now.

I would wait and see if we could use just the Roslyn version.

@Valloric
Copy link
Member

@mispencer What are your thoughts given the information @nosami presented?


Review status: 0 of 13 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.


Comments from the review on Reviewable.io

mispencer added a commit to mispencer/ycmd that referenced this pull request Sep 22, 2015
@mispencer
Copy link
Contributor Author

@nosami The issue was the http interface was slow. When I switched to the stdio interface, the performance issues went away.

@vheon No, I didn’t have to do anything to use the new container infrastructure for travis. I briefly had it building on OS X, and that didn’t require me to request access either.

The only missing feature in omnisharp-roslyn that blocking switching to it for everything, for me, is the lack of support for WantImportableTypes.

@Valloric I don’t urgently need this for anything. However, I’ve already had to fix merge conflicts twice, and I would prefer not have to do it again…


Review status: 0 of 13 files reviewed at latest revision, 3 unresolved discussions, some commit checks pending.


ycmd/completers/cs/cs_completer.py, line 239 [r5] (raw file):
Yes, Done.


ycmd/completers/cs/cs_completer.py, line 620 [r5] (raw file):
It's been removed.


ycmd/completers/cs/cs_completer.py, line 723 [r5] (raw file):
Done.


Comments from the review on Reviewable.io

@Valloric
Copy link
Member

@mispencer Sorry about the merge conflicts, that sounds painful. We need to keep the bigger picture in mind though; if @nosami says that the new API should be ready "any time now," it might be best to just hold off on this PR until then. We could then just fully switch to the new implementation instead of supporting switchable confs.

So let's wait for now. And here's a cut-off date so it's not indeterminate: if by December of this year the new intellisense API in omnisharp is not ready to the point that we can fully switch to it, then let's go with the switchable approach.


Review status: 0 of 13 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.


Comments from the review on Reviewable.io

@homu
Copy link
Contributor

homu commented Oct 2, 2015

☔ The latest upstream changes (presumably #240) made this pull request unmergeable. Please resolve the merge conflicts.

@vheon vheon mentioned this pull request Jan 1, 2016
@mispencer
Copy link
Contributor Author

Well, I have resolved the merge conflict and updated to the latest OmnisharpRoslyn. However, OmnisharpRoslyn doesn't seem to build without errors in either Windows or OS X, so I guess this is still on hold. It also seems a little flakey.

@vheon
Copy link
Contributor

vheon commented Jan 2, 2016

@mispencer did you tried it on your machine? Are the performance issues for the http interface resolved?

@willl
Copy link

willl commented Mar 21, 2016

@mispencer There's been a lot of work on omnisharp-roslyn recently (see the DEV branch) to work on Windows/OS X/Linux with the new .NET CLI bits. And that issue that you mentioned that you're blocked by has now been closed.

There's also been a new OmniSharp Slack team that has been created, and everyone is free to invite themselves into. Just visit the omnisharp-roslyn wiki if you would like an invite.

@homu
Copy link
Contributor

homu commented May 8, 2016

☔ The latest upstream changes (presumably #465) made this pull request unmergeable. Please resolve the merge conflicts.

@Valloric
Copy link
Member

@mispencer What's the state of this PR now? @willl mentioned blockers being fixed.

@mispencer
Copy link
Contributor Author

I have updated to the latest release, but I am still having problems.

  • I can't get it to work in Linux Travis. It depends on libunwind8, which seems to conflict with cmake in travis.
  • It doesn't seem to work for legacy project anymore - all the completions are empty, none of the goto work, etc.
  • I'm getting odd errors for Roslyn projects as well.

@homu
Copy link
Contributor

homu commented Jun 19, 2016

☔ The latest upstream changes (presumably #506) made this pull request unmergeable. Please resolve the merge conflicts.

@homu
Copy link
Contributor

homu commented Jan 18, 2017

☔ The latest upstream changes (presumably #601) made this pull request unmergeable. Please resolve the merge conflicts.

@Valloric
Copy link
Member

Is this PR now abandoned? We probably need to migrate to the roslyn backend at some point, and the issues @mispencer encountered might not be present anymore.

@mispencer
Copy link
Contributor Author

I attempted to get this working a few months ago without any more success.

@zzbot
Copy link
Contributor

zzbot commented May 12, 2017

@mispencer: 🔑 Insufficient privileges: Collaborator required

@zzbot
Copy link
Contributor

zzbot commented May 12, 2017

@mispencer: 🔑 Insufficient privileges: and not in try users

@Valloric
Copy link
Member

@mispencer Thanks for the heads-up. Also, ignore zzbot, it's misbehaving.

@Valloric
Copy link
Member

Let's close this PR then since it's not making progress.

@Valloric Valloric closed this May 12, 2017
@willl
Copy link

willl commented May 12, 2017

@mispencer Is it omnisharp-roslyn related issues you're having?

If so, perhaps jump into their slack team and see if you could get some help.

There is work underway for omnisharp-roslyn to support the language server protocol natively (also see), there are also plans underway for the server to run on top of a embedded copy of mono. The move to embedded mono should help resolve a lot of the runtime related issues. And LSP support may benefit if you if this project were an LSP client.

I don't know how far off these things are but I'm sure they will probably help in the long run when they're ready.

@Valloric
Copy link
Member

And LSP support may benefit if you if this project were an LSP client.

We will eventually have support for consuming LSP APIs. There's work being done on this already.

@mispencer
Copy link
Contributor Author

Could this PR be re-opened? I have had a need for this new backend, so I have been working on getting this working.

@bstaletic
Copy link
Collaborator

@mispencer You'll have to open a new pull request. "Reopen and comment is disabled because "The OmnisharpPoslyn" branch was force-pushed or recreated."

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

Successfully merging this pull request may close these issues.

9 participants