Class WorkProgressReporter
Reports the progress of a server's work to its client (LSP 3.17 §Work Done Progress, §window/workDoneProgress/create, §$/progress): of work done for a request that gave a token for it (WorkDoneToken), and of work the server begins of its own.
public sealed class WorkProgressReporter : IWorkProgressReporter
- Inheritance
-
WorkProgressReporter
- Implements
- Inherited Members
Remarks
Progress is for work that takes longer than an answer does (Threshold): work that is done sooner is reported nothing of at all - no token is created for it, and its client sees no progress flicker in and out. Work that is still going on then begins, with the last step it reported, and every step after; and once begun, it ends, whatever comes of it.
A client that gave no token, or one that does not support progress (window.workDoneProgress), is reported nothing: the work is done all the same.
Constructors
WorkProgressReporter(TimeSpan?)
Reports the progress of a server's work to its client (LSP 3.17 §Work Done Progress, §window/workDoneProgress/create, §$/progress): of work done for a request that gave a token for it (WorkDoneToken), and of work the server begins of its own.
public WorkProgressReporter(TimeSpan? threshold = null)
Parameters
thresholdTimeSpan?How long work goes on before its progress is reported; DefaultThreshold unless said otherwise.
Remarks
Progress is for work that takes longer than an answer does (Threshold): work that is done sooner is reported nothing of at all - no token is created for it, and its client sees no progress flicker in and out. Work that is still going on then begins, with the last step it reported, and every step after; and once begun, it ends, whatever comes of it.
A client that gave no token, or one that does not support progress (window.workDoneProgress), is reported nothing: the work is done all the same.
Properties
DefaultThreshold
How long work goes on before its progress is reported, unless said otherwise: longer than an answer takes, shorter than a wait is noticed.
public static TimeSpan DefaultThreshold { get; }
Property Value
Threshold
How long work goes on before its progress is reported.
public TimeSpan Threshold { get; }
Property Value
Methods
Attach(IServerWorkDoneManager)
Attaches the reporter to the server whose client it reports to: until it is, nothing is reported.
public void Attach(IServerWorkDoneManager manager)
Parameters
managerIServerWorkDoneManagerThe server's work done manager.
Begin(string)
Begins work the server does of its own - indexing a workspace, say - whose progress it reports to a token it creates
(window/workDoneProgress/create).
public IWorkProgress Begin(string title)
Parameters
titlestringWhat the work is, as the client shows it.
Returns
BeginFor(IWorkDoneProgressParams, string)
Begins work done for a request, whose progress is reported to the token the request gave for it; work for a request that gave none is reported nothing.
public IWorkProgress BeginFor(IWorkDoneProgressParams request, string title)
Parameters
requestIWorkDoneProgressParamsThe request.
titlestringWhat the work is, as the client shows it.