-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes gutter when cache is enabled (#2312)
Fixes dafny-lang/ide-vscode#187 The issue was that caching would prevent reports of implementations being finished to verify for the gutter reporting mechanism. I added it, and a test that I verified would not work in the absence of the fix. Changes * It also report all the results that were cached as if they were resolved immediately.
- Loading branch information
1 parent
d8d1ec7
commit 9dab9d7
Showing
6 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
Source/DafnyLanguageServer.Test/GutterStatus/CachedLinearVerificationGutterStatusTester.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text.RegularExpressions; | ||
using System.Threading.Tasks; | ||
using Microsoft.Dafny.LanguageServer.IntegrationTest.Extensions; | ||
using Microsoft.Dafny.LanguageServer.IntegrationTest.Util; | ||
using Microsoft.Dafny.LanguageServer.Language; | ||
using Microsoft.Dafny.LanguageServer.Workspace; | ||
using Microsoft.Dafny.LanguageServer.Workspace.Notifications; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using OmniSharp.Extensions.LanguageServer.Protocol.Models; | ||
using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; | ||
|
||
namespace Microsoft.Dafny.LanguageServer.IntegrationTest.Diagnostics; | ||
|
||
[TestClass] | ||
public class CachedLinearVerificationGutterStatusTester : LinearVerificationGutterStatusTester { | ||
private const int MaxTestExecutionTimeMs = 10000; | ||
|
||
|
||
|
||
// To add a new test, just call VerifyTrace on a given program, | ||
// the test will fail and give the correct output that can be use for the test | ||
// Add '//Next<n>:' to edit a line multiple times | ||
|
||
[TestMethod, Timeout(MaxTestExecutionTimeMs)] | ||
public async Task EnsureCachingDoesNotMakeSquigglyLinesToRemain() { | ||
await SetUp(new Dictionary<string, string>() { | ||
{ $"{VerifierOptions.Section}:{nameof(VerifierOptions.VerifySnapshots)}", "1" } | ||
}); | ||
await VerifyTrace(@" | ||
. S S | I $ | :method test() { | ||
. S | | I $ | : assert true; | ||
. S S | I $ | : //Next: | ||
. S S | I $ | :}"); | ||
} | ||
|
||
[TestMethod, Timeout(MaxTestExecutionTimeMs)] | ||
public async Task EnsureCachingDoesNotHideErrors() { | ||
await SetUp(new Dictionary<string, string>() { | ||
{ $"{VerifierOptions.Section}:{nameof(VerifierOptions.VerifySnapshots)}", "1" } | ||
}); | ||
await VerifyTrace(@" | ||
. S [S][ ][I][S][S][ ]:method test() { | ||
. S [O][O][o][Q][O][O]: assert true; | ||
. S [=][=][-][~][=][=]: assert false; | ||
. S [S][ ][I][S][S][ ]: //Next: | ||
. S [S][ ][I][S][S][ ]:}"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters