public void WillReinitializeContextOnDslSyntaxModified() { client.TextDocument.DidOpenTextDocument(new DidOpenTextDocumentParams() { TextDocument = DocumentFromText("", "RhetosAppFolder\\FolderWithApp2\\doc.rhe") }); Task.Delay(1500).Wait(); var projectContext = server.GetRequiredService <RhetosProjectContext>(); Assert.IsTrue(projectContext.IsInitialized); Assert.IsTrue(projectContext.ProjectRootPath?.Contains("FolderWithApp2")); var dslSyntaxFile = Path.Combine(Environment.CurrentDirectory, "RhetosAppFolder\\FolderWithApp2\\obj\\Rhetos", "DslSyntax.json"); Assert.IsTrue(File.Exists(dslSyntaxFile)); Assert.AreEqual(1, CountContainsAll(ServerLogs, "Initialized with RootPath", "FolderWithApp2")); File.SetLastWriteTime(dslSyntaxFile, DateTime.Now); Console.WriteLine($"Updating last modified of '{dslSyntaxFile}'."); Task.Delay(1500).Wait(); Assert.AreEqual(2, CountContainsAll(ServerLogs, "Initialized with RootPath", "FolderWithApp2")); DumpLogs(ServerLogs, "Server Logs"); }
private static Task InitializeAsync(ILanguageServer server, InitializeParams request, CancellationToken cancellationToken) { var logger = server.GetRequiredService <ILogger <Program> >(); logger.LogTrace("initializing service"); return(Task.CompletedTask); }