Skip to content
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

Support flycheck in csharp-mode #252

Closed
wants to merge 1 commit into from
Closed

Conversation

dtebbs
Copy link

@dtebbs dtebbs commented Oct 4, 2016

This could be an issue with my setup, but after upgrading to the latest version I couldn't get flycheck to run.

I seem to havecsharp-mode as my major-mode, whereas csharp-omnisharp-codecheck expects omnisharp-mode. I had to make this change to get things to work.

I'm no expert with this stuff, so happy to believe this is a problem with my .emacs file.
Currently I have:

(if (require 'omnisharp nil 'noerror)
    (progn
      (require 'company)
      (setq omnisharp--curl-executable-path "~/emacs-env/curl.exe")
      (setq omnisharp-server-executable-path "~/emacs-env/omnisharp-server/OmniSharp/bin/Release/OmniSharp.exe")
      (push 'company-omnisharp company-backends)
      (add-hook 'csharp-mode-hook 'company-mode)
      (add-hook 'csharp-mode-hook 'omnisharp-mode)
      (define-key omnisharp-mode-map (kbd "M-.") 'omnisharp-go-to-definition)
      )
  )

Should I see omnisharp-mode as the major-mode? If so, what am I doing wrong?

Thanks in advance for any help.

@hypercross
Copy link
Contributor

+1 This also happens to me on my spacemacs

@waldnercharles
Copy link

+1 This is happening with me as well.

@ngscheurich
Copy link

ngscheurich commented Nov 26, 2016

I'm similarly baffled, @dtebbs—it is my naive understanding that Flycheck checks against the current major mode, and that omnisharp-mode is exclusively a minor mode. I'm hoping someone will shed some light on this soon, but for now I've implemented a non-destructive change on my machine, i.e.:

:modes (omnisharp-mode csharp-mode)

Just in case.

@razzmatazz
Copy link
Contributor

@hypercross @waldnercharles @dtebbs

Sorry for getting to this issue so late, but can I ask any you to confirm if this issue persists on the omnisharp-roslyn branch too (https://github.com/OmniSharp/omnisharp-emacs/tree/feature-omnisharp-roslyn-support)?

As personally I have not encountered this on the roslyn branch, which is due to be released soon as master.

@dtebbs
Copy link
Author

dtebbs commented Feb 19, 2017

I haven't run against the omnisharp-roslyn branch, but I can see that the :modes line only refers to csharp-mode (like my patch above), and not omnisharp-mode. So it would seem this problem does not exist in omnisharp-roslyn.

@razzmatazz
Copy link
Contributor

@dtebbs – I am closing this PR now then as the original omnisharp-emacs code is now on legacy branch

@razzmatazz razzmatazz closed this May 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants