maralla / completor.vim

Async completion framework made ease.
MIT License
1.29k stars 63 forks source link

CSharp omnicompletion #195

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hey maralla,

First of thanks for the plugin, it runs smoothly for me and have yet to detect anything wrong with it.

For now I do struggle to get autocompletion working for csharp. As mentioned in the README, in the section about other languages

I should be able to have a working auto completion with the following settings:

autocmd FileType cs setlocal omnifunc=OmniSharp#Complete
let g:OmniSharp_server_path = '/opt/omnisharp-roslyn/omnisharp/OmniSharp.exe'
let g:OmniSharp_selector_ui = 'fzf'
let g:completor_cs_omni_trigger = '(.cs)$'

But even with the above mentioned settings, no completion is happening (server is running). And the manual trigger <c-x><c-o> results in a Pattern not found.

Any ideas on how to solve this specific issue or am I doing something wrong?

Thanks in advance

maralla commented 6 years ago

Well I have no experience with CSharp and have no environment to run it, so I can't(so lazy to) test it. But I have some suggestions to debug the problem.

  1. Make sure you have followed the instructions located at https://github.com/OmniSharp/omnisharp-vim to install the omni completion engine for csharp.
  2. Comment out the the line let g:completor_cs_omni_trigger and the line omnifunc=OmniSharp#Complete at your vimrc.
  3. Use the instructions in OmniSharp/omnisharp-vim to test whether the completion works or not. If not that's the problem of your installation of omnisharp, or go to step 4.
  4. Add the line let g:completor_cs_omni_trigger = '.*' and open a csharp file to test the autocompletion.
ghost commented 6 years ago

Hey maralla, thanks for the response!

Tried your suggestions, but none of them seemed to work. The omnisharp-roslyn server is running and registering events, but completion isn't kicking in.

info: OmniSharp.Http.Middleware.LoggingMiddleware[0]
      /checkalivestatus: 200 0ms
info: OmniSharp.Http.Middleware.LoggingMiddleware[0]
      /autocomplete: 200 0ms
info: OmniSharp.Http.Middleware.LoggingMiddleware[0]
      /autocomplete: 200 0ms
info: OmniSharp.Http.Middleware.LoggingMiddleware[0]
      /autocomplete: 200 0ms
info: OmniSharp.Http.Middleware.LoggingMiddleware[0]
      /autocomplete: 200 0ms
info: OmniSharp.Http.Middleware.LoggingMiddleware[0]
      /autocomplete: 200 0ms
info: OmniSharp.Http.Middleware.LoggingMiddleware[0]
      /autocomplete: 200 0ms
info: OmniSharp.Http.Middleware.LoggingMiddleware[0]

I used a similair setup using YCM, which did run fine at the time. I even wrote a bit about my findings on omnisharp-vim, but the guide was for version 1.xx and were are currently at the time of this writing at 2.1.105. I do however recall working on 2.x.x with YCM and similair setup for the and that was also working, so by logical deduction we can probably say that the problem is because completor.vim doesn't recognize the csharp omni function, or either I'm doing something completly wrong, which I think is the case here.

For now it would be nice if there was a native omni completions completor, but truthfully I don't have the energy to pick it up and dig into this issue further and I suspect you're not interested either, so maybe there is a loving soul somewhere willing to pick this up, that would be most welcoming :)

ghost commented 6 years ago

@maralla, this seems to be a msbuild system issue and has nothing to do with completor.vim.

I happened to get this working by installing msbuild-stable 15.6_xamarinxplat.2018.01.17.14.14_0xamarin1_ubuntu1404b1-3 and using step 4 of your debugging suggestions (specifying let g:completor_cs_omni_trigger = '.*').

There is currently an open issue for this problem. And would advise people having the same problems to keep an eye on this issue, till it is fixed.