Repository navigation
Fix build errors not being shown in the Error List - #2839
Conversation
|
|
|
|
Thanks @KevinRansom - I've pushed a potential fix. However I'm struggling to get builds working locally at the minute. I keep getting:
Does this look familiar? |
I do know that VS2010-2015 all did de-duplication - they called it "Error List Unification" or something. I wasn't involved in the implementation. But I don't know anything about how to achieve this with Roslyn. cheers! |
|
Calling @vladima as a shot in the dark to see if someone knows 😄 |
I saw this. I think I rebuilt "proto" and it went away. But i don't understand why we would be getting this error. |
|
I'm more concerned that the CI is failing with an error that I can't reproduce locally :/ @dotnet-bot test this please |
|
@dotnet-bot test this please Yeah @saul I don't know what's up. Jenkins says no identified problem... |
|
Okay the remaining failures are because the suggested errors are no longer collapsed in --vserrors mode. I'll get onto fixing these tests |
|
this is de-duplication done by Roslyn? the error from build doesn't have error code, so, I am not sure how Roslyn will do de-duplication? |
|
@heejaechang there's no way to supply the error code with DocumentTask. It's worth pointing out that the de-duplication worked in VS 2015 and prior. See IDEBuildLogger.cs for where the project system passes build errors to the platform. |
|
@saul is VS 2015 and prior used Roslyn? at the time, they might have their own way to do so, but Roslyn uses error code as one of way to do de-duplication. so without it, I dont think it will work. |
|
@KevinRansom @brettfo who should I talk about these issue? need to know how fsharp build errors are flown into Roslyn to see how we can do proper de-duplication. |
|
@heejaechang I can answer that. F# build errors are passed to the IDE via the ErrorListProvider, which is wrapped by a Microsoft.VisualStudio.Shell.TaskProvider. See DocumentTask.cs@506 in the F# code. I think the correct solution for this is to move over to Roslyn's ProjectExternalErrorReporter. We currently don't report any errors through this, but this class implements IVsLanguageServiceBuildErrorReporter2 so we can report build errors through the ReportError2 method. This is what the Roslyn project system does. |
|
@cartermp @KevinRansom this is now green :) I'll raise a ticket for fixing the duplication once this is merged |
|
@saul I'm away from my machine at the moment; do the changes to error messages change lightbulb behavior for misspelled tokens? |
|
@cartermp no, the errors reported via the compiler when --vserrors is supplied (like when you do Build Solution in the IDE) have been made so that they match the errors reported via IntelliSense. Lightbulb fixes are unaffected, this is just a step towards being able to unify the errors reported by IntelliSense and the compiler in the Error List. |
|
Makes sense. Was just curious since you touched the error message files themselves. I'll try this out tonight, but otherwise this all looks good. |
cartermp
left a comment
There was a problem hiding this comment.
Looks like my concerns weren't necessary. Good work!
|
@saul @cartermp Slightly off topic: I was using the latest nightly and for the first time with VS2017 saw some issues where error messages weren't appearing in the error list, (and no red suigglies) for some files that definitely contained errors. Strangely quickinfo and autocompelte were still correct and updating, which made it feel like some problem with processing diagnostics Perhaps fixed by this PR< perhaps not. I figured I should mention it so we can keep an eye out for problems. |
|
Some observations that will perhaps be of help while verifying any fix. I have been running VS 2017 on an Intel NUC D54250WYK from the day of release, and that's not a particularly powerful machine. I have been thinking that perhaps this makes it easier to observe these problems. Perhaps the Intellisense has low priority, and tends to loose the races on a less powerful machine. Just a thought. As I have previously reported in #2548, the situation on my machine has been hugely improved from around one month ago, and has been negligible since then. However, I did see something remarkable last week (Thursday at the earliest I believe) when I started to slash source away in huge chunks from the big solution I am working on, in order to create a minimal repro for another issue here. That turned out to be an incredibly effective way to provoke #2839 (this) and #2548. It was as bad as day one, with hundreds of errors and warnings being there when they shouldn't or vice versa. Some went away given a few minutes, and some just stuck until the solution was reopened. Have also observed the same on lesser scale earlier. UPDATE: I thought I would have to wait until tomorrow at least, for a fix, but I am already unable to reproduce what I have described above. Visual F# Nightly 15.4.1.17042401 and VS 15.1 (26403.7) |
|
Just to say I've been using the nightly (from two days ago) on FSharp.sln and the error list has some severe problems - lots of errors and red-squigglies were missing (intellisense errors, not build errors - I wasn't building from the IDE). I'm not sure if it will improve with this PR or if it is orthoginal. Will try the new nightly with this change when it is avaiable |
|
I've noticed that as well. It appears at the very top of the file. |
|
e.g., in |
* Delay GetService of IOleComponentManager Fixes dotnet#2548 * Remove error style from OutputPhasedDiagnostic/OutputPhasedErrorR * Fix another reference to OutputPhasedDiagnostic * Fixed more references * Updated error baselines to fix tests * Fix FSharpQA errors * Fix FSharpQA tests (again) * Fix error spans in FSharpQA
Fixes #2548
This was happening because we were trying to get IOleComponentManager too eagerly. I think something must have changed in the ordering of MEF services in VS 2017 as at project package instantiation (before Initialize is called), the service is null.
This change makes the lookup of IOleComponentManager lazy, and I've added an assertion to make sure this is caught in future instead of being silently swallowed.
I've also made some steps towards making the errors that IntelliSense returns and the errors that VS build returns be exactly the same. For example, ensuring that we're consistent in our line endings for multi-line error/warning messages.
Unfortunately this still hasn't triggered Roslyn to merge our IntelliSense and Build Errors, even when they're exactly the same error. See the screenshot below. I will ping @heejaechang when he is back in the office next week as supposedly he is more familiar with the de-duplication logic in the Error List.