Hacker News new | past | comments | ask | show | jobs | submit login

Have you ever managed to get intellisense working for c#? I try every few months with junk like Roslyn but it never seems to work. It just silently fails to do anything at all.



That was tricky to get working well, and for a while I hobbled along with gtags... but I do have it working now. And it wasn't that complicated, I was just missing an embarrassing piece of the puzzle.

But yes, basically

    (require 'csharp-mode)
    (require 'omnisharp)
    (setq omnisharp-expected-server-version "1.32.8")
    (add-hook 'csharp-mode-hook 'omnisharp-mode t)
Then omnisharp should be able to install and start a Roslyn server on its own with the corresponding commands.

The annoying issue that at first prevented this from working was that on OS X I also needed

    (require 'exec-path-from-shell)
    (exec-path-from-shell-initialize)
But figuring this stuff out was only a matter of reading the omnisharp-log buffer and guessing what the errors may be caused by.


One additional thing I've found that I needed (in Windows) is

    (setq omnisharp-server-executable-path "C:\\path\\to\\OmniSharp.exe")
So it can actually start the OmniSharp server (EDIT: Possibly because I haven't installed OmniSharp so much as just unzip it)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: