-
Notifications
You must be signed in to change notification settings - Fork 256
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
Fix caching of export declarations #4556
Fix caching of export declarations #4556
Conversation
ApplyChange(ref imported, ((0, 0), (0, 0)), "//comment" + Environment.NewLine); | ||
ApplyChange(ref importer, ((2, 18), (2, 19)), "true"); | ||
var diagnostics2 = await diagnosticsReceiver.AwaitNextDiagnosticsAsync(CancellationToken); | ||
Assert.Single(diagnostics2.Where(d => d.Severity == DiagnosticSeverity.Error)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to understand first, what is this testing? What was the behavior before? Wasn't the error reported and why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error was not reported because of an internal exception, and that occurred because the ExportModuleDecl
was retrieved from a cache when it should not have, which caused its references to be outdated, which caused a dictionary lookup failure.
@@ -18,6 +18,36 @@ namespace Microsoft.Dafny.LanguageServer.IntegrationTest.Various { | |||
public class CompilationStatusNotificationTest : ClientBasedLanguageServerTest { | |||
private const int MaxTestExecutionTimeMs = 10000; | |||
|
|||
[Fact] | |||
public async Task DidOpenOfEquivalentDocumentDoesNotTriggerCompilation() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test unrelated to the rest of the PR. Just had it laying around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, great to see more fix of export declarations.
…iment-trsplitexpr * commit '86840e6b14386c1e88480854dd8ce64ad17cb2ff': Map eq range (#4567) Fix: Declarations with {:only} ensure that other declarations aren't displayed as verified in the gutter icons (#4433) Fix caching of export declarations (#4556) Do not return exceptions when doing hover in a program with parse errors (#4557) Proof dependency warnings (#4542) [Test Generation] Reduce memory footprint by reusing the same Boogie program for multiple test generation queries (#4530) Fix a variety of bugs in Rust backend based on ESDK testing (#4538) Checker for .Values and .Items on maps (#4551) feat: Allow more assumptions in library backend (#4545) feat: Attributes on reads clauses (#4554) Fix gutter icons fields (#4549) Report errors that occur in the project file, in the IDE as well (#4539) Switch to ubuntu-20.04 for the refman build (#4555)
### Changes - Change the direction of the dependency between a module and its export declarations, so that the exports depends on the module instead of the other way around. The containing module already depends on the import declarations it contains, and now the export declaration indirectly depend on those imports as well. So if the imported modules change, the export declaration is recreated and resolved. ### Testing - Added XUnit test that reproduces the problem - Manually testing that this particular caching issue no longer occurs <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
Changes
Testing
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.