-
Notifications
You must be signed in to change notification settings - Fork 426
feat: lsp-progress #2649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change signature to async here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. But diff got big.
@@ -68,7 +74,8 @@ public static void ProjectInformation(this IEventEmitter emitter, | |||
References = references.Select(hashed => hashed.Value), | |||
FileExtensions = fileExtensions.Select(hashed => hashed.Value), | |||
FileCounts = fileCounts, | |||
SdkStyleProject = sdkStyleProject | |||
SdkStyleProject = sdkStyleProject, | |||
ProjectFilePath = projectFilePath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, why not move this back to the Initialized method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -2,6 +2,8 @@ namespace OmniSharp.Models.Events | |||
{ | |||
public static class EventTypes | |||
{ | |||
public const string ProjectLoadingStarted = nameof(ProjectLoadingStarted); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single one.
Done.
Resolves #2507
Example:
