-
Notifications
You must be signed in to change notification settings - Fork 685
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
Errors are duplicated in output window #1198
Comments
Hmmm... I'm not sure of switching over to "dotnet msbuild" as it might have other ramifications. @piotrpMSFT: will there be other fallout if we do this? E.g. will we break "dotnet build" telemetry? |
I think we want to fix dotnet/cli#5607 and then pass /clp:NoSummary and keep using build. |
Makes sense to me! (Very glad to have you active here this morning @nguerrera 😄) |
Turns out that The issue is with |
Just want add that I am still seeing this problem. I am using the 2.1-preview1 SDK, VS Code 1.21.0, omnisharp-vscode 1.15-beta1 on MacOS High Sierra. If I run |
To add to this, my experience is slightly off. I get the build error correctly once. When I click on the problems view, I click the problem, get the "Unable to open ..." popup and then a duplicate is created. I am able to click to duplicate and it takes me to the file in the workspace. The initial view that shows the unable to open popup has a source of "/" beside the file name. When the duplicate that works is created, the correct subdirectory of where that file exists is shown beside the file name. |
Any news on this? The problem is still present in the latest release of VSCode and the extensions. |
1 similar comment
Any news on this? The problem is still present in the latest release of VSCode and the extensions. |
Using /clp:NoSummary works for me even without pointing to a project file. The issue is that I cannot use it for all commands I am used to use. Is there a way to add this option to the csproj? Before I used a command to avoid error when clicking on items on the PROBLEMS list, it was GenerateFullPaths and set it to true. |
Yes, that was fixed a long time ago in CLI.
Do you mean that there are cli commands that do not work with /clp:NoSummary, or just that you don't want to pass it every time?
Unfortunately, no. But we have talked about a cli config system that would let you configure things like this per user or per directory
Which item? This issue is not closed. |
Yes, that was fixed a long time ago in CLI. |
microsoft/vscode#76318. This is the PR in vscode with the change to the build templates. |
This is fixed in both the extension and in vscode side, and will be available in the next releases. |
I am still experiencing the same problem after I followed the 'Steps to reproduce' of @nguerrera. I am on the latest version of vscode (1.38.1) and on the latest update on the C# extension (1.21.2), but I still have the errors duplicated. When I fix the deliberate error, the first line in the problems pane disappears almost immediately, but the second disappears only after I build the project. Is this a normal behaviour or maybe I have something misconfigured on the OmniSharp extension? Here is some information about my setup:
|
@akshita31 this appears to still be broken in latest vscode/addin even with a basic setup and is not a great out of the box experience.
tasks.json is the automatic one created by VS Code:
|
The cause of this problem is that the build task and the roslyn code analysis are both reporting the same issue. I've lodged a feature request against VS Code for the ability to filter the Problems panel by the problem owner (ie: "csharp" vs "msCompile"). In the meantime, is there anyway to suppress Omnisharp from generating these problem reports? I just want to see the actual build errors. |
@toptensoftware @akshita31 I would rather have the messages from Omnisharp than from the build task, if you click on an Omnisharp generated error it selects the problem in a better way than the error generated by the build task. I thought about a way of "merging" the messages from both sources but it turns out that even though we use the correct configurations (GenerateFullPaths) the messages do have some differences. @toptensoftware I understand that is not your proposal for a final solution though. |
For some situations I agree but right now I'm doing a large refactoring and I just want to get a particular sub-project to build before moving onto the next. The Omnisharp generated errors are saturating the problem panel with issues that I'm not ready to deal with them yet. I can work around it by ignoring those projects with omnisharp.json, but that's painful with a lot of sub-projects. Another situation: some of my projects have platform independent versions. eg: subproject.win.csproj, subproject.osx.csproj and subproject.gtk.csproj. If I switch from working on one platform to another (for the purposes of getting it to build I'll work on all three on under Windows), I have to edit omnisharp.json to ignore the projects that aren't applicable for the current platform. If I don't do that Omnisharp freaks out with out thousands of errors - making the problems panel completely useless. To explain what's happening here. With these platform specific projects I'll have a set common of files and a set of per-platform files. The platform specific files will be in sub-folders "PlatformWin", "PlatformOsx" etc... and each are a partial class providing the platform implementation part of the common class file. The .win.csproj file is configured to only include PlatformWin, similar for the other platforms. Omnisharp really doesn't like this and generates 3 errors for every per-platform partial method that its multiply defined.. Granted, I might be in a bit of a unique situation with the above but being able to either filter the problems panel by problem owner, or being able to configure Omnisharp to stop putting stuff in the problem panel would help immensely. Another way of saying all of the above - by being able to limit the problems panel to just stuff from the current build it can react to the selected build task configuration and let me focus on what I'm working on. |
FWIW: It's now 2021 and I still get errors duplicated between Ominsharp and the build task's I'd rather lose compile-time errors than real-time reporting and the compile-time errors are a major annoyance anyway, because they stick around long after the file has been modified and require that the build task actually be re-run to clear out. |
I also have duplicated Messages in the Problem tab with v1.66.0. {
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build debug",
"command": "dotnet",
"type": "shell",
"args": [
"build",
// Ask dotnet build to generate full paths for file names.
"/property:GenerateFullPaths=true",
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
]
} Changing the property |
I'm also getting duplicate warnings like everyone. |
Just commenting to add that I've been spending days trying to solve this, hunting around on discord, stack overflow, making reddit posts, etc. and I haven't been able to get rid of the duplicate errors. Problem matcher is essentially the same as what everyone else has posted. |
Environment data
dotnet --info
output:VS Code version: 1.9.0
C# Extension version: 1.6.2
Steps to reproduce
Expected behavior
Each error appears only once in output window
Actual behavior
Errors are duplicated.
Workaround
Edit tasks.json to disable the summary:
Notes
Visual Studio arranges not to duplicate errors in its output windows, but VS Code does not.
Related: dotnet/sdk#823, dotnet/cli#5607
The text was updated successfully, but these errors were encountered: