-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not kill LSP server process when exception occurs in doc change ha…
…ndler, and prevent out of range exception (#2664) - Do not kill LSP server process when exception occurs in status update handler - Prevent out of range exception, fixes #2665
- Loading branch information
1 parent
f424f1f
commit 0d7e282
Showing
5 changed files
with
63 additions
and
16 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
36 changes: 36 additions & 0 deletions
36
Source/DafnyLanguageServer.Test/Various/IncludeFileTest.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,36 @@ | ||
using System; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using DafnyTestGeneration; | ||
using Microsoft.Dafny.LanguageServer.IntegrationTest.Extensions; | ||
using Microsoft.Dafny.LanguageServer.IntegrationTest.Util; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Microsoft.Dafny.LanguageServer.IntegrationTest.Various; | ||
|
||
[TestClass] | ||
public class IncludeFileTest : ClientBasedLanguageServerTest { | ||
|
||
[TestMethod] | ||
public async Task MethodWhosePostConditionFailsAndDependsOnIncludedFile() { | ||
var temp = (Path.GetTempFileName() + ".dfy").Replace("\\", "/"); | ||
Console.WriteLine("temp file is: " + temp); | ||
var producer = @" | ||
function Foo(x: int): bool { | ||
x == 2 | ||
}".TrimStart(); | ||
var consumer = $@" | ||
include ""{temp}"" | ||
method Bar(x: int) | ||
ensures Foo(x) {{ | ||
}}".TrimStart(); | ||
await File.WriteAllTextAsync(temp, producer); | ||
var documentItem2 = CreateTestDocument(consumer); | ||
client.OpenDocument(documentItem2); | ||
var verificationDiagnostics = await GetLastDiagnostics(documentItem2, CancellationToken); | ||
Assert.AreEqual(1, verificationDiagnostics.Length, verificationDiagnostics.Stringify()); | ||
await AssertNoDiagnosticsAreComing(CancellationToken); | ||
} | ||
} |
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