-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
SemanticModel.GetDiagnostics(FullSpan) doesn't always produce symbol declared events for all declarations in the tree #7446
Comments
FYI: @JohnHamby @gafter @srivatsn Compiler seems to produce symbol declared event only when all the containing member declarations across all its declaring syntax references have been completed. See here for example. We probably need a dedicated completion part for symbol declared events and do it irrespective of whether its members have completed or not. Invoking force complete on a symbol should always guarantee symbol declared event to be generated for it. Note that I haven't tried the repro on VB yet, but I presume it has similar implementation and will repro there as well. |
I think the compiler implements an invariant that we do not produce a symbol declared event until all members have had their events produced. We can change that, as I suspect nobody depends on it. |
Is there any workaround we can implement in the meantime, or is this something where we just have to provide release notes and wait for Update 2? |
@gafter Thanks - yes we need to change the compiler's invariant. I will add couple of skipped unit tests today for this scenario. Unfortunately, any symbol/syntax node analyzer can be badly affected by this race in IDE live analysis. @sharwell I think the following workarounds might work, but you should verify if it doesn't regress typing perf:
|
@sharwell I think your other reports about missing StyleCop diagnostics |
I just verified that workaround 1 fixes the issue for the repro analyzer as well |
@gafter I am not sure why this got changed from a bug to a feature request:
Regardless of whether this gets tracked as a bug or feature request, we must ensure that it gets fixed soon, and surely before 1.2. FYI: I have sent PR #7472 with skipped unit tests for this issue. |
@mavasani I changed it to a feature request because the original implementation correctly implements the original specification, and this is a request to change the specification. I agree that from the end user's point-of-view the result is that the system as a whole does not work as expected, and I agree that it should be changed (and I will change it) as soon as possible. |
Thanks Neal! |
See dotnet#7446 and dotnet#7477 for details. Note that VB unit test for dotnet#7446 passes fine with current sources, but test for dotnet#7477 needs identical fix to C#.
to explain how the placement relaxes the ordering constraints Related to dotnet#7446
Yes, Neal is correct. This fix is right and infact necessary, otherwise IDE will miss running analyzers and reporting diagnostics. I will investigate how to reduce the allocations on top of this change. |
…around Work around dotnet/roslyn#7446
Another item for @KevinH-MS to verify the perf on latest Roslyn bits - please re-assign to me if the regression still exists. |
@KevinH-MS This issue is no longer actionable, as the fix has been checked in. |
Oh, I see you've assigned it to yourself for perf work. |
What is the status of this bug? It is labeled as fixed in December and reassigned for perf work. No updates since then. Moving out of update 2 as this doesn't seem to be relevant here. |
I think @KevinH-MS already confirmed perf was fine again with a follow up change - he can probably confirm and close this out. |
Moving to Area-Performance based on the conversation history here. |
Yes, to the best of my knowledge, this is no longer an issue. |
Expected: There is always at least one analyzer diagnostic "Type name contains lower case letters" in error list. When you have single namespace N1 - there should be exactly one analyzer diagnostic for
N1.Class
. When you have namespace N and N1 - there should be 2 diagnostics:N.Class
andN1.Class
.Got: For cases where you have both files with namespace
N1
, analyzer diagnostic is intermittent. It shows up sometimes, but for most occasions it doesn't show up, even if you wait for minutes.Cause: New IDE analyzer driver in VS2015 Update1 relies on compilation events for driving analysis. Basic assumption that invoking
SemanticModel.GetDiagnostics(fullSpan)
will generate symbol declared events for all symbols declared in the file is getting violated intermittently by the compiler layer. More specifically, for the above repro,SemanticModel.GetDiagnostics(fullSpan)
doesn't produce symbol declared events for either N1 or Class on some occasions when both files have N1, and we end up with no analyzer diagnostics for those cases.The text was updated successfully, but these errors were encountered: