OmniSharp / omnisharp-emacs

Troll coworkers - use Emacs at work for csharp!
GNU General Public License v3.0
512 stars 94 forks source link

Changes to class files in subfolder are not available in other files #509

Open lilwhitemouse opened 4 years ago

lilwhitemouse commented 4 years ago

I have my .csproj file in ~/project, and most of my .cs files in are in ~/project. I have classMain.cs and classA.cs I created a new file ~/project/classA/classB.cs If I am editing classMain, and then open classA.cs and add a new method static public void Test() { }, then in classMain, I can see classA.Test(); However, if I edit classB.cs and addstatic public void Test() { }, if I am in classMain, I do not see classB.Test(); If I restart emacs, it now sees classB.Test();

I expected to see classB.Test() immediately

I followed instructions on https://github.com/OmniSharp/omnisharp-emacs and everything else seems to be working fine. Am I doing something wrong?

Thank you, this project has been a lifesaver.

razzmatazz commented 4 years ago

Hi @lilwhitemouse

Yes, this can happen (due to some synchronisation bug). What I do is I hit “C-x C-v” to reload the buffer as a workaround–this makes omnisharp-emacs to submit content of the buffer to the server and may fix your issue.

Sadly, we are slowly deprecating this package in favor of “lsp-mode” / eglot which uses the same server but via lsp protocol. You may want to try it out if this issue is getting annoying since I don’t plan to do any bigger fixes/changes to this project anymore.