-
Notifications
You must be signed in to change notification settings - Fork 166
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
Any plans to integrate into YouCompleteMe's Completer API? #13
Comments
Not any plans at the moment but maybe in the future. I've been shying away from using a custom build of Vim on windows because of a regression that crept in recently without me realising. I'm sticking to the stock download which is Vim 7.3 with patches 1-46 currently. I've been playing around with a slightly modified AutoComplPopup plugin which is working ok for me. What advantages are there to using their API? |
Hey there, I wanted to ask the exact same question, as I planned to implement a completer for YCM for C#. However, when I asked around in the Let me first try to answer your question regarding advantages in using YCM's API. The advantages of using YCM's API that are currently mentioned on the site are the following:
In addition to this, it says: "If you want to upstream your completer into YCM's source, you should use the Completer API." You might wonder why you would want to upstream the C# completer into YCM. Let me try to state some of the advantages that come to my mind right now.
I understand it is currently a bit more work to install ycm, since it requires a newer version of vim than is currently available as a download package. But keep in mind that that's just a temporal thing. |
OK. I'm sold. The asynchronous completions won it for me. I have a stack of other things that I'd like to see get done first though that are not autocomplete related. I'd be more than happy if you could do it. I need all the help I can get to be honest! If not, I'll get around to it sometime. It sounds like it would be a compelling feature for a lot of people. I'm not against the feature requiring a newer version of vim to use, so long as current functionality isn't broken for users wishing to stick with a stock vim. Thanks. |
I'm unexpectedly very busy at the moment, so it will not be able to do some work for a while. Just to inform :) |
I've got something working. However, the scope is not correctly recognized. Only top-level completions are offered. Do you know what I'm doing wrong? The relevant file can be found here: https://github.com/Chiel92/YouCompleteMe/blob/master/python/completers/cs/cs_completer.py |
My guess would be that you need to set parameters['wordToComplete']. This should be set to the current letters that are to be completed. For example, if you had Console.Wri then parameters['wordToComplete'] should equal 'Wri'. Good luck! |
YCM handles the partial word stuff, so we don't have to send it. What to do next? I would like to do a pull request to YCM, but before doing that we have to make sure that installing and starting the omnisharp server is neat and easy. I saw something about starting omnisharp from within vim on the todo list. Is there any progression on that? |
I'm glad you got it working, well done! There are performance benefits to sending the partial word to OmniSharp though. We don't need to fetch the XML documentation for completions that don't need to be returned. I guess YCM is filtering later on. No progress made on starting OmniSharp from within Vim... but it should be trivial. I was thinking of just scanning upwards through the folders from the the current source file until the solution was found and just start that one (assuming that there is only one solution file). If more than one was found, then we'd have to prompt the user. |
Yep, I was thinking of the latter too. For your information, this issue may be of your interest: ycm-core/YouCompleteMe#207 About the partial word; YCM uses a fuzzy search algorithm. That's why it wants to do the filtering by itself. I do not experience any performance problems at the moment. If that changes, this may have to be reconsidered though. |
OmniSharp has fuzzy searching built in now too. You won't experience any degradation at the moment I guess as the Documentation completion isn't working yet on Linux. That's on my TODO list :) |
I'm home now (only home at weekends) and I just tried your YouCompleteMe completer plugin on my Linux box. That's seriously cool! |
It works pretty well indeed :) Especially together with the ultisnips plugin. |
I made a start on starting OmniSharp within Vim last night. Nearly done, but not ready to commit yet. Should be in tomorrow night sometime. |
Thanks for pointing that out! For me (on linux) it is different though, since I only see the "short version" in both places. |
👍 for YCM integration is this already in master or is there a place I can test it out? =B |
@vito-c You can use OmniSharp master combined with @Chiel92's YCM fork here https://github.com/Chiel92/YouCompleteMe. If you already have YCM installed, you should just be able to copy the YouCompleteMe / python / completers / cs folder from Chiel92's repo. |
Nice :) |
@Chiel92 Anything else I need to do for this? |
I guess we're almost done. What about the options I proposed in #24? |
Don't have access to my linux vm right now... but that doesn't look right. Doesn't look like you have the monodoc documentation. |
That's weird, since I'm sure I have your latest revision. |
I looked at your code and Description and DisplayText are the wrong way around again. I think I should have named those better. They make more sense the other way around :) When I get a minute I think I'll switch those over at my end (or take a pull request ;) ). I'm at work right now, so can't test this. I might get some time tomorrow evening. |
Indeed they are the other way around again :) But still no documentation in either of them, right? |
I swapped the displaytext and the description in the correct order again. No docs though. |
Does it work for you without YCM? |
Neither without YCM. I uninstalled YCM, and triggered the omnicompleter with |
Strange. You had it working previously, right? The code hasn't changed around this. Do you have monodoc installed at /usr/lib/monodoc? I also noticed that you only have one parse method, whereas I have 4 overloaded methods. (I used |
When I tested your justed implemented monodoc support, I indeed believe to saw more then I do now. But I believe to remember many entries didn't have docs. Not sure, since I tested really briefly. I can confirm to have monodoc in /usr/lib/monodoc. |
Well, many entries don't have documentation, but int.MaxValue isn't one of |
Monodoc didn't work for me either after a fresh checkout. Turns out that the server submodule was pointing to the wrong commit. Git submodules suck :) It should work now. If it doesn't do a |
I did a PR: ycm-core/YouCompleteMe#365 |
Hope they accept it! |
Closing. Good job @Chiel92 :) |
It currently works nicely with YouCompleteMe (via omnifunc) but from the YCM docs it sounds like there are advantages to using their API.
The text was updated successfully, but these errors were encountered: