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

The namespace 'namespace' already contains a definition for 'classname' #466

Closed
bklebe opened this issue Dec 17, 2018 · 7 comments
Closed

Comments

@bklebe
Copy link

bklebe commented Dec 17, 2018

I'm using OmniSharp Emacs from MELPA on Windows and Mac with Flycheck and I get a bunch of these lints in every C# buffer that I open, including saying that methods are ambiguous between the two classes and so forth. I am quite certain I haven't actually duplicated every class in my project. I've tried it with VSCode and I can get the same error if I edit the buffer, and it's fixed by doing "Restart OmniSharp" in the C-S-p menu. (dotnet/vscode-csharp#785) I have tried restarting the server in Emacs and this does not appear to fix the problem. Any ideas?

@ForLoveOfCats
Copy link

#464

@bklebe
Copy link
Author

bklebe commented Dec 17, 2018

Ah, thank you. Sorry for duplicating.

@bklebe bklebe closed this as completed Dec 17, 2018
@razzmatazz
Copy link
Contributor

razzmatazz commented Dec 17, 2018

No problem. As this is starting to bug people I think I need to take a look at this sooner.

This has started to happen since the update to one of the versions in 1.32.x series of the omnisharp-roslyn server.

A workaround for the time being is to set the variable omnisharp-expected-server-version to some version lower than (1.32.6) – I don't remember correctly which one – and invoke M-x omnisharp-install-server.

You can set this variable via:

  • a (setq ...) in your /.emacs.d/init.elor.spacemacs` file, or
  • M-x customize-variable

@bklebe
Copy link
Author

bklebe commented Dec 17, 2018

I've been getting quite good at Emacs Lisp lately, if this is something you'd like help with. I typically use JetBrains Rider or Visual Studio 2017 but I miss my Emacs keybinds and magit and everything, so I'm trying to make my setup for .NET development work in my favorite Unix text editor ;). Thank you so much for making this work in Emacs!

@razzmatazz
Copy link
Contributor

@beeuhtricks welcome! I am half a noob too and willing to help/guide if you want to do a PR.

@bklebe
Copy link
Author

bklebe commented Dec 17, 2018

@razzmatazz I would love to do a PR. Reading #464 it seems like the solution is to block on interacting with the server until it has loaded the project. At a guess this would entail putting all the code that interacts with the server in a block and making sure it has logic to interact synchronously with the server? I know Emacs Lisp doesn't really have threads.

@razzmatazz
Copy link
Contributor

(I will answer in #464)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants