-
Notifications
You must be signed in to change notification settings - Fork 687
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
Omnisharp not showing up despite reinstall of everything #2391
Comments
So I can get it to work with a new project, but not single If I run From the output window it looks like the it is starting the Omnisharp server when I open the project folder, but not when I open individual Is there a way to tell Omnisharp I want it to run for individual files as well as projects? |
@nicmar Do you have an "omnisharp log" option in your output window? @benm-eras You are correct. There's currently no support for standalone .cs files. We're tracking that work with OmniSharp/omnisharp-roslyn#207. |
@rchande no, the output window is totally empty. There is no "flame icon" which I think there should be for omnisharp. I have tried disabled and enabling the extension "C# for Visual Studio Code (powered by OmniSharp).", but nothing happens. I uninstalled it, restarted vscode, installed it again, and the second time I got this in the output:
But still nothing. Where is that "Omnisharp log" option supposed to be? There is one option in the select box to the right called C# which shows the log above. The others are like this: Log (Main)
Log (Shared)
Log (Window)
Log (Extension host)
Does any of these make any sense? :) |
Same issue for me. I launched a new VS Code window, created a new file, pasted some C# code into it, set the language to C#, and tried to format it. No "Format" option in the context menu, and selecting "Format Document" from the command palette produces the follow error:
Please label this as a bug. |
In my case, it was the lack of the |
@nicmar To be clear, you're opening a .cs file that's associated with some .csproj? Also, can you share the contents of your vscode settings? I'm particularly curious about your values for settings whose names start with |
@rchande Hi, I'm using Unity to open a .cs file, but now I see that I don't have a .csproj file named like my project, I have several different like: It used to work without a csproj file I believe, as I don't remember deleting one, but stopped working at some point. Can I recreate it from Unity or from VScode somehow? I have since the problems started reinstalled vscode and the c# extension, so at the moment I have nothing in my vscode settings. Maybe I should start over with a new Unity project to see if works from there, and maybe move over to that one if it does. Hmm, thanks a lot for taking the time to help me out! |
Yes, with a new project omnisharp works, and this has no .csproj file, however it has a .sln file. My problematic project also has a .sln file which looks very similar to the other one. Is there anything in here that I should inspect? |
Is it a given that a simple formatter should require a |
@stamminator The formatting support is enabled by OmniSharp and currently Omnisharp doesnot support standalone C# files. As @rchande mentioned , we are tracking that work in OmniSharp/omnisharp-roslyn#207 |
@nicmar From the logs you shared , it seems that OmniSharp should have started. Could you try setting "omnisharp.path" : "latest" in the settings and then restarting the Omnisharp server (Ctrl+Shift+P --> Restart OmniSharp), and see if any OmniSharp log comes up ? |
Hi, I set that in my user settings, and restarted VSCODE, and also tried "Restart omnisharp", but I can't see any log anywhere. All 4 logs are empty. When I press Ctrl+Shift+P -> Select project, it says "Select 1 of 0 project", so it might be that omnisharp doesn't know what project I'm working with. I see this in the Git log, don't know if it's related.
I'm trying to uninstall and reinstall the C# extension, but not really seeing anything, here's from the Log (shared): [2018-07-05 11:27:41.167] [sharedprocess] [info] Downloaded extension: csharp Anything else I can try? How I open the project so omnisharp detects it? Like I said, it worked on another new project from Unity. |
@nicmar If it works on a new Unity project, this is probably an issue with your existing projects. Given that you have several .csproj files, if you use Code to open one of the directories that contains a .csproj, and then open a .cs file that is included in that .csproj, what happens? |
I also have this issue. I am using the latest version of VScode to edit standalone .cs files, but it tells me "There is no document formatter for 'csharp'-files installed." every time I press ctrl+shift+f. |
@willscire Just to confirm, is your C# extension working in scenarios where you have both .cs and .csproj files? I believe failure to format standalone cs files is the same issue we're tracking at OmniSharp/omnisharp-roslyn#207 |
For me helped when I switched from workspace project to folder project |
The latest version of the C# extension - 1.16.0 is out. We have added the support to edit csharp files without the projects. Please let us know if that resolves the problem. |
@akshita31 works for me! I created a standalone .cs file with abysmal formatting, right-clicked, selected "Format Document", and everything became pretty. |
This wasn't working for me (still getting the error 'no formatter for csharp installed...). I'm using a workspace with more than one csharp project. The non-obvious solution was F1 > "OmniSharp: Select Project" and to select my current project. Only then did code formatting etc start to work. I didn't realise OmniSharp only supported one project at a time in workspaces. |
@nicmar Does the error reproduce for you for the latest version of the extension (1.16.2) ? |
It just repro'd for me on 1.16.2 for a stray C# file in my repository. |
@jkoritzinsky Have you opened the folder in which the file is present ? |
I've opened a parent folder (5 folders down from the root). Would the fact that I'm in a multi-folder workspace cause an issue? For reference I'm working on the dotnet/coreclr repo on a unit test project. |
@jkoritzinsky OmniSharp doesn't fully support multi-root workspaces yet (OmniSharp/omnisharp-roslyn#909), so yes, that could be the problem. |
FWIW, I just saw this error in my workspace, and it turned out it was for a completely external reason: The OmniSharp log showed |
There still appears to be an issue with workspaces. I have three projects (all have .csproj) - one of which is the executable with two libraries. When I load the workspace in VSCode, Omnisharp always recognizes n - 1 of the projects. I can consistently make this happen. There are no errors or anything "wrong" showing up in the Omnisharp logs. It just never scans one of the folders that's being loaded into the workspace. Perhaps this is a different issue? |
@jasoncavett Please file a separate issue and include
Thanks! |
In my case, it's also missing omnisharp log in the oputput dropdown, then I switch it to c#, finding out it stuck in downloading something. so I reconfig my wifi and vpn, restart vscode to let this download to finish. After that Omnisharp log shows in the dropdown and everything works. |
There have been lots of improvements since this issue was opened. Please open a new issue with logs if you are still running into this. |
Everything has been working great for several weeks, all of a sudden it doesn't report errors anymore and Intellisense seems to only suggest hits from inside the current file.
Environment data
dotnet --info
output:VS Code version: 1.24.1
C# Extension version: 1.15.2
Steps to reproduce
I reinstalled the C#-extension several times and it seems to succeed:
I also installed dotnet CLI-tools, which I don't think I had before, I think I just added the setting to ignore it. I also installed MonoFramework-MDK-5.10.1.47.
Expected behavior
The flame icon should show up in the status bar, and errors showing up/intellisense working.
Actual behavior
Omnisharp doesn't seem to load.
I'm not sure if it autoupdated or something, cause it just stopped working from one day to another. If it did, can you disable autoupdates to prevent this from happening again?
Thankful for any tips!
The text was updated successfully, but these errors were encountered: