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

Issue when using mono? #23

Closed
vito-c opened this issue May 12, 2013 · 19 comments
Closed

Issue when using mono? #23

vito-c opened this issue May 12, 2013 · 19 comments

Comments

@vito-c
Copy link

vito-c commented May 12, 2013

Starting Server:
mono ./OmniSharp/bin/Debug/OmniSharp.exe -s /Users/vito-c/workrepos/myproject/project.sln

I am pretty sure the server is running on port 2000 (I can open localhost:2000/autocomplete in a browser and when I tried to echo "ack" to a port it gave me a bad response error back)

In Vim:
I start to type a method then type and it gives me: Could not connect to http://localhost:2000/autocomplete

Error Dump From Server:
System.InvalidOperationException: Operation is not valid due to the current state of the object
at System.Linq.Enumerable.First[IProject](IEnumerable1 source, System.Func2 predicate, Fallback fallback) [0x00000] in :0
at System.Linq.Enumerable.First[IProject](IEnumerable1 source, System.Func2 predicate) [0x00000] in :0
at OmniSharp.Solution.CSharpSolution.ProjectContainingFile (System.String filename) [0x00000] in :0
at OmniSharp.Parser.BufferParser.ParsedContent (System.String editorText, System.String filename) [0x00000] in :0
at OmniSharp.AutoComplete.AutoCompleteHandler.CreateProvider (OmniSharp.AutoComplete.AutoCompleteRequest request) [0x00000] in :0
at OmniSharp.AutoComplete.AutoCompleteModule+c__AnonStorey15.<>m__31 (System.Object x) [0x00000] in :0
at Nancy.Routing.Route.Invoke (Nancy.DynamicDictionary parameters) [0x00000] in :0
at Nancy.Routing.DefaultRouteInvoker.Invoke (Nancy.Routing.Route route, Nancy.DynamicDictionary parameters, Nancy.NancyContext context) [0x00000] in :0
at Nancy.Routing.DefaultRequestDispatcher.Dispatch (Nancy.NancyContext context) [0x00000] in :0

@nosami
Copy link
Contributor

nosami commented May 12, 2013

I don't think this is a mono specific problem. I'm using mono as we speak. Do you have the latest OmniSharp? This looks like an issue that @gwilliams fixed a couple of days ago.

@nosami
Copy link
Contributor

nosami commented May 12, 2013

The unable to connect to server message is pretty pointless right now. It displays that whenever there is any exception on the client. It's on my (huge) list of stuff to sort out.

@gwilliams
Copy link
Contributor

Just for info, I'm using the latest master with mono on OSX without any issues.

@vito-c
Copy link
Author

vito-c commented May 12, 2013

yup i'm using the latest on master... does it matter what my current working directory is when I launch vim? My sln was generated by unity3d could this be the issue? Should I try using the OmniSharp.sln? would that be a good test to validate my system is setup correctly?

@nosami
Copy link
Contributor

nosami commented May 12, 2013

Working directory shouldn't make any difference.

I think that it would be a good smoke test to use the OmniSharp sln. It's what I always use ;) I've tried OmniSharp on quite a few solutions now though without any issues. It's probably far from bullet proof though.

If your code isn't sensitive, I could take a look at it if you like.

@vito-c
Copy link
Author

vito-c commented May 12, 2013

I think the issue is related to a Unity3d sln The OmniSharp.sln worked fine and I got some nice completion :) Let me whip together a sample project for you.

@vito-c
Copy link
Author

vito-c commented May 12, 2013

Here is a really bare bones example: https://github.com/vito-c/ExampleUnity

@nosami
Copy link
Contributor

nosami commented May 12, 2013

@vito-c Thanks for that. I'll take a look.

@nosami
Copy link
Contributor

nosami commented May 12, 2013

@vito-c I just commited a fix for this.

@vito-c
Copy link
Author

vito-c commented May 12, 2013

awesome thanks so much! The Example Project works but I am still seeing errors in my main project :(

Project /Users/vito-c/workrepos/mobile/MobileProject/Assembly-CSharp-firstpass.csproj has unsupported type {4C2D6F16-28F7-6964-F259-E4608E3E113F}
Project /Users/vito-c/workrepos/mobile/MobileProject/Assembly-CSharp.csproj has unsupported type {4C2D6F16-28F7-6964-F259-E4608E3E113F}
Project /Users/vito-c/workrepos/mobile/MobileProject/Assembly-CSharp-Editor.csproj has unsupported type {4C2D6F16-28F7-6964-F259-E4608E3E113F}

@nosami
Copy link
Contributor

nosami commented May 12, 2013

@vito-c I just added that GUID as a new csharp project type. Should work now.

@vito-c
Copy link
Author

vito-c commented May 12, 2013

I added {4C2D6F16-28F7-6964-F259-E4608E3E113F} to the case statement and the server started up and looks like it's working! now to try the YCM completer.. thanks so much for writing this project!

@nosami
Copy link
Contributor

nosami commented May 12, 2013

👍

@nosami nosami closed this as completed May 13, 2013
@thinca
Copy link
Member

thinca commented May 16, 2013

hi.
My project is also using Unity3D.
The GUID of my project is another value. It's seems the MD5 of project name.

@nosami
Copy link
Contributor

nosami commented May 16, 2013

Could you verify that? Could you send a pull request, or failing that, your sln file?

@thinca
Copy link
Member

thinca commented May 16, 2013

md5("ExampleProject") == "cfbf81bea5a883230e2fc9b25881c624"
Although I tried some samples, it was altogether matched.

@thinca
Copy link
Member

thinca commented May 16, 2013

pull request

Should all project type ids be accepted?

@nosami
Copy link
Contributor

nosami commented May 16, 2013

I'm not so sure.... I don't know what would happen if a VB.Net project was part of the solution for example and it could result in unnecessary parsing. I think we should just check to see if md5("projectname") == "projectguid" unless there is a better way to identify it as a C# project.

@thinca
Copy link
Member

thinca commented May 16, 2013

I think we should just check to see if md5("projectname") == "projectguid" unless there is a better way to identify it as a C# project.

LGTM

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

4 participants