OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.72k stars 168 forks source link

running omnisharp server prints motd #753

Closed BreachSim closed 2 years ago

BreachSim commented 2 years ago

Hello!

I running into a weird issue that didn't happen before.

When I execute the omnisharp server it prints the motd

The server was working fine before and Im not sure it is related to omnisharp but the run command is the only executable that makes it happen. It is also happens only the first time I run the command, any subsequent attempt to execute the run commands starts the server as expected.

Thanks!

➜  ~ ~/.cache/omnisharp-vim/omnisharp-roslyn/run
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 4.19.128-microsoft-standard x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Jan 24 13:12:50 EST 2022

  System load:  0.06               Processes:             21
  Usage of /:   5.4% of 250.98GB   Users logged in:       0
  Memory usage: 7%                 IPv4 address for eth0: 192.168.164.111
  Swap usage:   0%

 * Super-optimized for small spaces - read how we shrank the memory
   footprint of MicroK8s to make it the smallest full K8s around.

   https://ubuntu.com/blog/microk8s-memory-optimisation

0 updates can be applied immediately.
nickspoons commented 2 years ago

I see you've also opened this with omnisharp-roslyn which is what I would have suggested, it's not really an omnisharp-vim issue.

Is this the most recent version of the server? You can output the version with:

$ cat ~/.cache/omnisharp-vim/omnisharp-roslyn/OmniSharpInstall-version.txt
v1.38.0

If it does not output v1.38.0, install the latest version with :OmniSharpInstall.

BreachSim commented 2 years ago

It's v1.38.0

Feel free to close the issue as it is not related to omnisharp-vim itself.

Quick question though, Since I am able to start the server by invoking the command twice, is there a way from vim to attached to an already running server or will it try to start one every time I open the first code file?

Thanks for your answer!

nickspoons commented 2 years ago

No unfortunately, with the stdio server there's no way to attach vim to a running instance (we used to be able to do this with the old HTTP server).

nickspoons commented 2 years ago

As a workaround, try just running :OmniSharpStopServer (if necessary, probably not if it didn't start properly) and then :OmniSharpStartServer from your vim session. It'd be nice if the second startup worked? Fingers crossed...

BreachSim commented 2 years ago

Thanks for the suggestion, unfortunately I already tried that but it is not working.

nickspoons commented 2 years ago

Hmm. Annoying.

I wonder if mono could be the culprit? If you want to be adventurous (and you're working with dotnet projects, not .NET Framework), you could try the NET6 PR which uses the new OmniSharp-roslyn NET6 mode and doesn't use mono: #746

To try it you'll need to pull the PR version of OmniSharp-vim, add let g:OmniSharp_server_use_net6 = 1 to your .vimrc, restart vim, then reinstall the server with :OmniSharpInstall to get the correct version.

BreachSim commented 2 years ago

It works!! You made my day. Thank you so much for your help.

nickspoons commented 2 years ago

Great to hear! I finally realised why the tests in that PR were failing too, so I've now merged the PR.