-
Notifications
You must be signed in to change notification settings - Fork 90
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
Omnisharp doesn't work at all in Emacs 28.1 #527
Comments
When I change my (require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(setq packages '(soft-stone-theme flycheck markdown-mode json-mode yaml-mode format-all lsp-mode lsp-pyright company))
(dolist (package packages)
(package-install package))
(add-hook 'after-init-hook (lambda () (load-theme 'soft-stone t)))
(add-hook 'after-init-hook #'global-flycheck-mode)
(eval-after-load
'company
'(add-to-list 'company-backends 'company-omnisharp))
(add-hook 'csharp-mode-hook #'company-mode)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(display-line-numbers 'relative)
'(package-selected-packages
'(omnisharp csharp-mode company lsp-pyright lsp-mode format-all yaml-mode json-mode markdown-mode flycheck soft-stone-theme)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
) and open any
It doesn't work even when I move: (eval-after-load
'company
'(add-to-list 'company-backends 'company-omnisharp))
(add-hook 'csharp-mode-hook #'company-mode) to
|
Same issue, on Windows 11, Emacs 28.1 |
this is most probably random gibberish from omnisharp via stdin that is being interpreted as json.. maybe an error message.. could you run /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/run directly from the terminal? you should see the actual error messages/blurb it is emitting to the stdio IIRC the arguments to start omnisharp-roslyn in stdio mode is:
|
|
oh, this looks very much like a mono/runtime issue (?) and should be reported to omnisharp-roslyn (underlying language server) repository: |
I've created the issue in their repo. ;) |
In the meantime, have you tried using emacs/lsp-mode (or joaotavora/eglot) for C# on emacs? Are there any issues? Because eventually omnisharp-emacs will get deprecated.. |
No, I don't see any benefit for my self in eglot. I've used just package.el. |
Oh, I am not sure I expressed myself properly, basically on emacs (AFAIK) there are 5 options to get C# integration in the editor:
option (a) is a bit outdated, as LSP mode is being actively developed, both the clients and servers |
I am trying to set this up for the first time in 28.2. is this realistic, I can't get anything but syntax color highlighting to work? |
I don't know why it doesn't work as expected. I've done the following steps:
omnisharp
to mypackages
variable in~/.emacs
M-x load-file RET ~/.emacs
dotnet new console --name Test
dotnet new sln --name Test
dotnet sln add ./Test/Test.csproj
git init
emacs -nw ./Test/Program.cs
M-x omnisharp-install-server
M-x omnisharp-start-omnisharp-server
M-x company-mode RET
Note that I've tried to build project via
dotnet build
after no completion appeared and restarted Emacs with 7-10 steps repeated with no result...No completion is shown for
Console.
. I wanna manually start omnisharp server to check whether it works and after it hook it start to opening C# files.My
~/.emacs
is:The last failed attempt to fix this problem was adding:
right before
custom-set-variables
. I restarted Emacs,M-x omnisharp-start-omnisharp-server
asked me to install omnisharp server (again?). I installed it, started viaM-x omnisharp-start-omnisharp-server
but no completion appeared.Sometimes I obtain
Package cl is deprepated
error. It seems it happens only at first server start.The text was updated successfully, but these errors were encountered: