-
Notifications
You must be signed in to change notification settings - Fork 677
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 does not display all errors/warnings in VSCode #812
Comments
Hi, if this is a largeish Unity project (e.g. >= 1000 .cs source files), this is generally expected. In that case, the extension will only retrieve errors and warnings for open files to avoid constantly chewing CPU. FYI, the link to your omnisharp log does not work me. |
Hi It is large, but nowhere near that large.
|
In any case, the files were open. |
I'd love to take a look at your project if you're able to provide it. Perhaps we broke something. Also, you might consider trying the latest beta of the C# extension available here and see if that improves the issue. |
Here are some screenshots and the log that is visible in them |
Ok, is it possible to install that from within VSCode or do I have to do some manual work here? (this is literally the first time I have tried using VSCode, so I am not very familiar with how the plugins work yet). I will send you an email. |
FWIW, the warnings in the log are produced when OmniSharp uses MSBuild to perform a design-time compilation of your project in order to gather up source files and references. However, OmniSharp does not return those. There's a separate endpoint that requires errors and warnings live from your code. |
You can install it within VS Code. Go to the Extensions pane, click the three dots at the top-right of the pane and select "Install from VSIX..." |
Ok, but it is supposed to be able to get those warnings/errors from the other endpoint as well, right? |
Installing the beta did not seem to resolve the problem unfortunately. Here is the log for the beta version: http://pastebin.com/r7gh70Bd I sent you an email with the project. |
@bsell93 I also saw that once. The errors were not valid however, I think it was because I had just deleted some files and Unity had not rewritten the project file, so omnisharp was logging errors about that. I don't think it is related to this issue however. |
I see. Yeah, I am not sure what is going on. They are definitely errors, because I intentionally made them 😁. |
I have the same problem. This happened after the update VS Code to version 1.6 |
I found a solution: in v.1.5.3 all working. |
@shlapkoff were you referring to mine or @bsell93's problem? |
@shlapkoff thanks! That fixed my issue! |
I see, so this is a recent regression with 1.6? @jrieken, have you heard any other reports of the Problems pane not displaying all errors & warnings? |
@DustinCampbell For me downgrading to 1.5.3 did not work unfortunately. |
Is there anything else I could try to help you debug this issue? |
I'm getting this constantly with a .NET core solution as of VSCode 1.6, too. Errors appear for a second, then totally disappear. But e.g. |
@HalfVoxel Can you check the output of the developer console in VS Code? That might contain some useful data to let me understand this better/ |
@HalfVoxel I have in mind the problem @bsell93 |
@HalfVoxel re #812 (comment) - just to clarify: you see this with 1.6 and also 1.5.x? or only with 1.6? |
@jrieken I see this with both 1.5.3 and 1.6. |
Sounds like it's under control, but just in case: VS Code: 1.6.0, on Arch Linux x64 using visual-studio-code from the AUR, package version 1.6.0-2 Shot of developer tools on re-opening VS Code, introducing a syntax error which quickly disappears, with a bunch of tabs open: Slightly cut-down (unrunnable but buildable) version of my pure C# project which shows the issue (1.7MB): Repro:
Potentially of interest here: I use a few extensions, I have a .sln file and a global.json and a .xproj file I don't actually use, and there is a fair bit of C# in here using dynamic and unsafe and plenty of PInvoke declarations. In my recent attempt, I got no console errors doing this. Even though I reproduced the 'syntax error disappears' issue successfully. shrugs Above project is not open source, and is not licensed for wider distribution except in aid of fixing VS Code & Omnisharp issues. I will remove the link once this issue is solved. If you need any help, ask. If needed I can try specific VS Code builds, or provide more files, or potentially remote desktop access. edit OmniSharp log: http://pastebin.com/u8i0ivJj Given this is affecting Unity workspaces too, perhaps this is related to having >1 project in a workspace? |
The developer console (assuming you mean the chrome dev tools) unfortunately logs exactly nothing. I watched it while restarting omnisharp and having a file opened which contains things it should warn about. |
Does Omnisharp actually check for those warnings at all (assigned but not used private fields)? |
Don't think so. But my repro steps require the user to specifically introduce a syntax error; the .zip as-is is buildable. |
Thanks lads. Hacking my local, already-transpiled copy of the extension (in I look forward to getting my squigglies back on an official basis. Thanks again for looking into this. |
@leafi: Glad to hear it! |
v1.5-beta4 of the extension is now available containing this fix. |
File on that release is called |
Sigh... it's early. 😄 Will fix shortly. |
Fixed 😄 |
Thx. v1.5-beta4 indeed fixes the issue. |
Confirmed working for me as well! Good job! |
@DustinCampbell Not sure if I'm seeing a different issue, or this is just how its supposed to work, but I'm not seeing errors where I expect to see them. Here's what I'm doing:
At this point, I don't see any of the errors I see from I assumed this was because I need to somehow explicitly trigger a build through Omnisharp, but I can't find a way to do so. The only two Omnisharp related options I have available in the command palette are: "Omnisharp: Restart Omnisharp", and "Omnisharp: Select Project", and I've already used the latter to select the project containing the errors. I also tried running "Tasks: Run Build Task", but this results in the output:
Here's what the Omnisharp generated
I'd appreciate any guidance on whether I should be expecting errors to pop up as I work (and so there is a bug), or if I need to build the projects through VS Code using some approach I've missed. The project I'm working with is a Github fork, so if this is an actual bug rather than PEBKAC, I can push up all my work and give you a link. |
@aggieben installing .vsix's by hand is sadly pretty confusing. You can NOT double click them. Instead you need to open them as a file from VS Code. |
That's right. In VS Code, select View->Extensions. Then, at the top-right of Extensions pane click the [...] and select "Install from VSIX..." |
@DustinCampbell Any thoughts on my earlier comment? Is the discrepancy between |
@masaeeedu: Sorry for the delay. What you described doesn't look like the same problem that everyone else was experiencing in this thread. Could you file a separate issue? Also, if you have a project that reproduces the problem, that'd be helpful too. |
I have the beta4 extension installed now, and after the last code update (1.6.1), this issue is manifesting again. Update: it seems to only be happening for some files. Not sure what's going on. |
I still have this issue and I'm using VS Code 1.6.1 and Omnisharp 1.5.0-beta4. I have multiple projects with a global.json file. |
The issue as originally filed was about .csproj/.sln on Unity projects. For any experiencing this issue on project.json, could you please file a separate issue? |
I'm using VS Code 1.6.1 and and Omnisharp 1.5.0-beta4 for my Unity project, the issue here was solved but the flame icon used to show "xxxx.sln" now says "0 projects" even through I select the .sln in the list. Other than that everything is fine. |
Today installed 1.7.1 and the issue is back again. Need help guys cant really work like this. (Tried uninstalling and reinstalling 1.5.0beta4 without result). |
@DustinCampbell I've put up repro steps for a project.json codebase in #843. |
OK. I'm going to close this issue. The latest bits are working for most folks and new issues have been opened for further work. |
same here, when I move the cursor, the red underline squiggles disappear. Not sure why this issue keeps getting closed, it's quite an alive and real bug ;) I tried the patch csharp-1.5.0-future-preview1.vsix but same issue |
Environment data
dotnet --info
output:.NET Command Line Tools (1.0.0-preview2-003131)
Product Information:
Version: 1.0.0-preview2-003131
Commit SHA-1 hash: 635cf40e58
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.11
OS Platform: Darwin
RID: osx.10.11-x64
VS Code version:
1.6.0
C# Extension version:
1.4.1
Steps to reproduce
Open a project with several errors/warnings in it (a project that you can replicate this bug in is available upon request).
Expected behavior
Omnisharp displays all errors/warnings in the Problems window in VSCode
Actual behavior
Omnisharp only displays a few or no messages even though in the omnisharp log I can clearly see them and have verified that they are valid errors/warnings (or... at least sometimes the log contains all warnings/errors, sometimes it does not). I have uploaded my omnisharp log here.
This is in a clean install with no other extensions. The project is a Unity project, but I doubt that should matter.
VSCode also logs "Some projects have trouble loading. Please review the output for more details." however I cannot see anything suspicious in the log even with verbose logging enabled. Though it is pretty large so I might have missed something.
Restarting VSCode or the Omnisharp server does not solve it.
I have not tried to reduce my project to a smaller size and checked if it still happens, but I am more than happy to share my project with anyone to try to debug it.
For a while it would simply display one or sometimes a few warnings (I was fixing a lot of unused 'using' declarations) and I had to fix the single warning that was displayed, wait while it re-processed everything and then fix the next warning that would then show up.
The text was updated successfully, but these errors were encountered: