feat: lsp-progress#2649
Conversation
| string projectPath = (string)args; | ||
| IWorkDoneObserver projectObserver = _server.WorkDoneManager | ||
| .Create(new WorkDoneProgressBegin { Title = $"Loading {projectPath}" }) | ||
| .GetAwaiter() |
There was a problem hiding this comment.
Can we change signature to async here?
There was a problem hiding this comment.
Done. But diff got big.
| FileCounts = fileCounts, | ||
| SdkStyleProject = sdkStyleProject | ||
| SdkStyleProject = sdkStyleProject, | ||
| ProjectFilePath = projectFilePath |
There was a problem hiding this comment.
The ProjectConfigurationMessage is used for some rudimentary telemetry. Passing ProjectFilePath may include some PII. Instead of using this message you would likely want to add a new Message type for ProjectLoadFinished.
| await Task.WhenAll( | ||
| _compositionHost | ||
| .GetExports<IProjectSystem>() | ||
| .Select(ps => ps.WaitForIdleAsync()) | ||
| .ToArray()); | ||
|
|
||
| _workDoneObserver?.OnNext(new WorkDoneProgressReport | ||
| { | ||
| Message = "Language Server ready", | ||
| Percentage = 100, | ||
| }); | ||
| _workDoneObserver?.OnCompleted(); |
There was a problem hiding this comment.
I don't think we want to wait for project loading to complete here. You could extract it to a method and just fire and forget.
There was a problem hiding this comment.
Actually, why not move this back to the Initialized method?
There was a problem hiding this comment.
Because in order to send lsp-progress messages to client server must be initialized.
Otherwise there are warnings that server it not initialized and messages about initialization are got all at once after server is initilized.
…r/anakael/add-lsp-progress
| { | ||
| public static class EventTypes | ||
| { | ||
| public const string ProjectLoadingStarted = nameof(ProjectLoadingStarted); |
There was a problem hiding this comment.
Does this event mean that we have started loading all projects or that we have started loading a single project? If it means a single project then I would recommend ProjectLoadStarted. Same with the Finished event.
Resolves #2507
Example:
