public Task HandleNotificationAsync(string methodName, JToken methodParam, Func <JToken, Task> sendNotification) { try { // intercept any "temp" file paths that contain codestream-diff info // and do not send them along to the agent if (methodParam != null && methodParam["textDocument"] != null && methodParam["textDocument"]["uri"] != null && CodeStreamDiffUri.IsTempFile(methodParam["textDocument"]["uri"].Value <string>())) { return(Task.CompletedTask); } #if DEBUG Log.Verbose(methodName + " " + methodParam.ToString()); #endif } catch (Exception ex) { Log.Error(ex, nameof(HandleNotificationAsync)); } return(sendNotification(methodParam)); }
public void TryParseFileNameTest(string filePathPart, string fileName, bool expected) { Assert.AreEqual(expected, CodeStreamDiffUri.TryParse(filePathPart, out CodeStreamDiffUri result)); Assert.AreEqual(fileName, result.FileName); }
public void IsTempFileTest(string filePathPart, bool expected) { Assert.AreEqual(expected, CodeStreamDiffUri.IsTempFile(filePathPart)); }