public NewCodemarkNotification(Uri uri, Range range, CodemarkType type, string source) { Uri = uri.ToString(); Range = range; Type = type; Source = source; }
public async Task NewCodemarkAsync(Uri uri, Range range, CodemarkType codemarkType, string source, CancellationToken?cancellationToken = null) { if (IsReady) { try { _ = BrowserService.NotifyAsync(new NewCodemarkNotificationType { Params = new NewCodemarkNotification(uri, range, codemarkType, source) }); } catch (Exception ex) { Log.Error(ex, $"{nameof(NewCodemarkAsync)} Uri={uri}"); } } await Task.CompletedTask; }
public Task EditorSelectionChangedNotificationAsync(Uri uri, EditorState editorState, List <Range> visibleRanges, int?totalLines, CodemarkType codemarkType, CancellationToken?cancellationToken = null) { if (!IsReady) { return(Task.CompletedTask); } try { _ = BrowserService.NotifyAsync(new HostDidChangeEditorSelectionNotificationType { Params = new HostDidChangeEditorSelectionNotification(uri, editorState.ToEditorSelectionsSafe(), visibleRanges, totalLines) }); } catch (Exception ex) { Log.Error(ex, $"{nameof(EditorSelectionChangedNotificationAsync)} Uri={uri}"); } return(Task.CompletedTask); }