-
Notifications
You must be signed in to change notification settings - Fork 89
Description
I don't know why it doesn't work as expected. I've done the following steps:
- add
omnisharpto mypackagesvariable in~/.emacs M-x load-file RET ~/.emacsdotnet new console --name Testdotnet new sln --name Testdotnet sln add ./Test/Test.csprojgit initemacs -nw ./Test/Program.csM-x omnisharp-install-serverM-x omnisharp-start-omnisharp-serverM-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:
(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 csharp-mode omnisharp 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)
(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.
)
The last failed attempt to fix this problem was adding:
(setq omnisharp-expected-server-version "1.32.0") ; https://github.com/OmniSharp/omnisharp-vscode/issues/1450#issuecomment-432516876
(let ((dotnet-version (string-trim (shell-command-to-string "dotnet --version"))))
;; https://github.com/OmniSharp/omnisharp-emacs/issues/459#issuecomment-452656947
(setenv "MSBuildSDKsPath" (format "/usr/share/dotnet/sdk/%s/Sdks" dotnet-version)))
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 via M-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.