Skip to content

Improve LSP project load progress messages - #84744

Merged
JoeRobich merged 1 commit into
mainfrom
dev/jorobich/update-projectloading-messages
Aug 3, 2026
Merged

Improve LSP project load progress messages#84744
JoeRobich merged 1 commit into
mainfrom
dev/jorobich/update-projectloading-messages

Conversation

@JoeRobich

@JoeRobich JoeRobich commented Aug 3, 2026

Copy link
Copy Markdown
Member

The current progress event title and message are duplicated. This updates them to be unique. Providing more detail in the message while keeping the title short and relevant.

Current:
Title: Loading C:\Users\JoeRob\Source\roslyn\main\roslyn.slnx
Message: Loading C:\Users\JoeRob\Source\roslyn\main\roslyn.slnx

After:
Title: Loading roslyn.slnx
Message Loading xxx projects

Copilot AI review requested due to automatic review settings August 3, 2026 22:38
@JoeRobich
JoeRobich requested a review from a team as a code owner August 3, 2026 22:38
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts Language Server Protocol (LSP) work-done progress strings for solution/project loading to avoid duplicated title/message text by introducing a new Loading_projects resource and by shifting more detail into progress report messages (including an initial 0% report with the project count).

Changes:

  • Add new localized resource key Loading_projects (“Loading projects...”) across LanguageServerResources.resx and all xlf locales.
  • Update project/solution open progress titles to use shorter strings (including switching solution progress to use the file name).
  • Update project loader to emit an initial WorkDoneProgressReport with Message = Loading {N} project(s)... and Percentage = 0, and adjust tests/utilities to assert this behavior.
Show a summary per file
File Description
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hant.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.zh-Hans.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.tr.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ru.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pt-BR.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.pl.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ko.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.ja.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.it.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.fr.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.es.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.de.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/xlf/LanguageServerResources.cs.xlf Add Loading_projects localization entry (new/untranslated).
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServerResources.resx Add Loading_projects resource string.
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/OpenSolutionHandler.cs Use solution file name (not path) in loading/loaded progress strings.
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/OpenProjectsHandler.cs Use Loading_projects for progress title when opening projects.
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectLoader.cs Emit initial 0% progress report with project-count message.
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/AutoLoadProjectsInitializer.cs Adjust progress title vs. start/end messages for auto-load flows.
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer.ProcessHost.UnitTests/Workspaces/AutoLoadProjectsTests.cs Update assertions to new progress titles and validate initial 0% report.
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer.ProcessHost.UnitTests/Utilities/AbstractLanguageServerClientTests.cs Add helper to await the first WorkDoneProgressReport in tests.

Copilot's findings

Suppressed comments (2)

src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/OpenProjectsHandler.cs:51

  • CreateWorkDoneProgressAsync still sets Title and begin Message to the same string (Loading projects...), so clients that display both will continue to show duplicated text. Since WorkDoneProgressTracker now emits a 0% progress report with the detailed count message, consider leaving the begin Message empty to avoid duplication.
        await using var progressReporter = await _workDoneProgressManager.CreateWorkDoneProgressAsync(
            reportProgressToClient: true,
            title: loadingMessage,
            startMessage: loadingMessage,
            endMessage: string.Format(LanguageServerResources.Loaded_0_projects, projectsLength),

src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/AutoLoadProjectsInitializer.cs:98

  • Same as the VS Code default-solution path case: this solution auto-load path uses an empty startMessage, which can lead to a blank begin message in clients if no progress reports are emitted. Consider using a non-empty, non-duplicative start message like LanguageServerResources.Loading_projects.
                    await StartAndReportProgressAsync(
                        (reporter) => projectSystem.OpenSolutionAsync(solutionFiles[0], reporter),
                        title: string.Format(LanguageServerResources.Loading_0, solutionFileName),
                        startMessage: string.Empty,
                        endMessage: string.Format(LanguageServerResources.Loaded_0, solutionFileName));
  • Files reviewed: 20/20 changed files
  • Comments generated: 2

Comment on lines 48 to +52
await using var progressReporter = await _workDoneProgressManager.CreateWorkDoneProgressAsync(
reportProgressToClient: true,
title: loadingMessage,
startMessage: loadingMessage,
endMessage: string.Format(LanguageServerResources.Loaded_0, solutionPath),
endMessage: string.Format(LanguageServerResources.Loaded_0, solutionFileName),
Comment on lines 72 to +76
await StartAndReportProgressAsync(
(reporter) => projectSystem.OpenSolutionAsync(solutionPath, reporter),
startMessage: string.Format(LanguageServerResources.Loading_0, solutionPath),
endMessage: string.Format(LanguageServerResources.Loaded_0, solutionPath));
title: string.Format(LanguageServerResources.Loading_0, solutionFileName),
startMessage: string.Empty,
endMessage: string.Format(LanguageServerResources.Loaded_0, solutionFileName));
@JoeRobich
JoeRobich enabled auto-merge (squash) August 3, 2026 23:09
@JoeRobich
JoeRobich merged commit db11709 into main Aug 3, 2026
27 of 28 checks passed
@jjonescz jjonescz added this to the 18.11 milestone Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants