omnisharp-emacs icon indicating copy to clipboard operation
omnisharp-emacs copied to clipboard

`(void-variable it)` errors when starting omnisharp server with Emacs 28 native comp

Open Ruin0x11 opened this issue 3 years ago • 11 comments

This may be related to #516.

Using Emacs 28 with native compilation enabled, this error occurs when starting the server.

Debugger entered--Lisp error: (void-variable it)
  omnisharp--read-lines-from-process-output(#<process OmniServer<4>> "{\"Event\":\"log\",\"Body\":{\"LogLevel\":\"INFORMATION\",\"N...")
  (let* ((messages-from-server (omnisharp--read-lines-from-process-output process message-part)) (error-message (concat "The server sent an unknown json message. " "Inspect the omnisharp-server process buffer " "to view recent messages from the server. " "Set `omnisharp-debug' to t and inspect the " "*omnisharp-debug* buffer for this error specifical...")) (json-messages (-map #'(lambda (json-string) (omnisharp--json-read-from-string json-string error-message)) messages-from-server))) (-map #'omnisharp--handle-server-event json-messages))
  omnisharp--handle-server-message(#<process OmniServer<4>> "{\"Event\":\"log\",\"Body\":{\"LogLevel\":\"INFORMATION\",\"N...")

If I add these lines to my config the error stops occurring.

(setq no-native-compile t
      load-no-native t)

Ruin0x11 avatar May 11 '21 19:05 Ruin0x11

Hi @Ruin0x11 -- just noticed your issue on doom emacs :)

I just started running emacs28+nativecomp myself (albeit with lsp-mode) -- but will try to see what little fix can be done to aleviate this issue.

razzmatazz avatar May 17 '21 17:05 razzmatazz

Hmm, I could not replicate this issue on my mac with latest doom emacs. Do you have the latest omnisharp-emacs/doom installed? Do you have any specific project settings?

I installed server using M-x omnisharp-install-server and my test projects has succeeded in loading it.

razzmatazz avatar May 17 '21 17:05 razzmatazz

I think this is the problem from dash. Try reinstall it may work.

jcs090218 avatar May 18 '21 04:05 jcs090218

Sorry, I had only noticed this repo was deprecated in favor of lsp-mode a short time ago. I thought it was still maintained because it came bundled with doom-emacs. I've since switched to using lsp-mode.

I should at least mention that I reinstalled dash and my entire Emacs system again, but those didn't fix the problem. I'm using Windows Server 2019.

I'll close this for now.

Ruin0x11 avatar May 18 '21 04:05 Ruin0x11

I try to maintain this once a while to fix breakages, but no new features are planned.

razzmatazz avatar May 18 '21 05:05 razzmatazz

@razzmatazz any work around for this? Having the same issue on emacs28+nativecomp myself. I prefer this package to lsp for some feature like symbol-rename and jump to a definition imported from a .dll.

Thanks for your work and inputs.

CsBigDataHub avatar May 28 '21 01:05 CsBigDataHub

I managed to replicate this myself with emacs28+nativecomp. Running the code under non-nativecomp (regular) build apparently does NOT trigger the issue..

razzmatazz avatar May 30 '21 13:05 razzmatazz

@razzmatazz any work around for this? Having the same issue on emacs28+nativecomp myself. I prefer this package to lsp for some feature like symbol-rename and jump to a definition imported from a .dll.

Thanks for your work and inputs.

On a related note, @CsBigDataHub can you vouch for my PR https://github.com/OmniSharp/omnisharp-roslyn/pull/2079 where I am trying to merge in my changes so jump-to-definition-in-dll would work in LSP mode for omnisharp-roslyn? :) I can't get them to review/merge my PR so that one is stuck...

razzmatazz avatar May 31 '21 05:05 razzmatazz

@razzmatazz any work around for this? Having the same issue on emacs28+nativecomp myself. I prefer this package to lsp for some feature like symbol-rename and jump to a definition imported from a .dll.

Thanks for your work and inputs.

On a related note, @CsBigDataHub can you vouch for my PR https://github.com/OmniSharp/omnisharp-roslyn/pull/2079 where I am trying to merge in my changes so jump-to-definition-in-dll would work in LSP mode for omnisharp-roslyn? :) I can't get them to review/merge my PR so that one is stuck...

Sure, let me build the project with your PR and test it out. Will update soon.

CsBigDataHub avatar May 31 '21 05:05 CsBigDataHub

Btw I fixed this by adding (require 'dash) to every single file in the omnisharp project

benjamin-asdf avatar Jul 24 '21 11:07 benjamin-asdf

I have merged a PR that attempts to fix this issue with the change proposed by @rtnlmeme-DestroyerOfDeath -- will take some time to be updated to melpa.

razzmatazz avatar Jul 25 '21 19:07 razzmatazz