summaryrefslogtreecommitdiffstats
path: root/tools/slang-test/test-context.cpp
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2025-06-16 11:42:45 -0700
committerGitHub <noreply@github.com>2025-06-16 11:42:45 -0700
commit07f79b943c3041dd18137d72893af260b75ddcf9 (patch)
tree57e4d9cd95c118bee0265d4593ee9853547394c7 /tools/slang-test/test-context.cpp
parent28d957327b113335167846a6501d548b07132da2 (diff)
Disable periadic diagnostic update on language-server on CI (#7445)
The "textDocument/publishDiagnostics" Notification in the official Language Server Protocol, or LSP for short, is a notification that the server sends to the client such as VSCode or Visual Studio without the client having to ask for it. Its purpose is to provide a list of errors, warnings, or other informational "squiggles" for a specific file. Because the notification is an asynchronous push notification, it is receieved as an unexpected RPC message during the slang-test CI tests. When a notificatoin is unexpectedly sent to slang-test, the communication goes out-of-sync and the rest of language-server based tests intermittently fails. In order to address the problem, this PR adds a new command-line argument to change the behavior of the notification and it will be sent in a more deterministic manner where the notification can be sent only in one of three cases: didOpen, didChange, and didClose. Because these evets are only ways to cause a new notification, we can still expect to get the same diagnostic messages without missing any of them. For slang-test CI test, this new option will be used to make the notification more deterministic.
Diffstat (limited to 'tools/slang-test/test-context.cpp')
-rw-r--r--tools/slang-test/test-context.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/slang-test/test-context.cpp b/tools/slang-test/test-context.cpp
index d1b809766..ede12d0d7 100644
--- a/tools/slang-test/test-context.cpp
+++ b/tools/slang-test/test-context.cpp
@@ -213,6 +213,8 @@ SlangResult TestContext::createLanguageServerJSONRPCConnection(RefPtr<JSONRPCCon
{
CommandLine cmdLine;
cmdLine.setExecutableLocation(ExecutableLocation(exeDirectoryPath, "slangd"));
+ cmdLine.addArg("-periodic-diagnostic-update");
+ cmdLine.addArg("false");
SLANG_RETURN_ON_FAIL(Process::create(cmdLine, Process::Flag::AttachDebugger, process));
}