From 9134286eba2056e9d09c247f39ed881dda815481 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 14 Sep 2026 08:54:55 -0700 Subject: [PATCH 1/2] Add on-demand project loading setting Expose the Roslyn LSP project loading option through VS Code configuration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5615e2cd-8b86-40a5-808b-47f8fa893b35 --- package.json | 5 +++++ package.nls.json | 1 + 2 files changed, 6 insertions(+) diff --git a/package.json b/package.json index 6a2ef2602..12a8ae558 100644 --- a/package.json +++ b/package.json @@ -1561,6 +1561,11 @@ "default": true, "description": "%configuration.dotnet.projects.enableAutomaticRestore%" }, + "dotnet.projects.loadOnDemand": { + "type": "boolean", + "default": true, + "description": "%configuration.dotnet.projects.loadOnDemand%" + }, "dotnet.projects.enableFileBasedPrograms": { "type": "boolean", "default": true, diff --git a/package.nls.json b/package.nls.json index 6971ab685..c6abe1361 100644 --- a/package.nls.json +++ b/package.nls.json @@ -47,6 +47,7 @@ "configuration.dotnet.server.environmentVariables": "Custom environment variables to pass to the language server process. Specify as key-value pairs, for example: { \"DOTNET_GCName\": \"libclrgc.dylib\" }. (Requires extension restart)", "configuration.dotnet.enableXamlTools": "Enables XAML tools when using C# Dev Kit. (Requires extension restart)", "configuration.dotnet.projects.enableAutomaticRestore": "Enables automatic NuGet restore if the extension detects assets are missing.", + "configuration.dotnet.projects.loadOnDemand": "Loads projects when a language feature first requests a file they contain instead of loading every project at startup.", "configuration.dotnet.projects.enableFileBasedPrograms": "Enables the \"file-based programs\" (dotnet run app.cs) experience.", "configuration.dotnet.projects.enableFileBasedProgramsWhenAmbiguous": "Enables the \"file-based programs\" (dotnet run app.cs) experience in files where the editor is unable to determine with certainty whether the file is a file-based program. Only respected when `dotnet.projects.enableFileBasedPrograms` is `true`.", "configuration.dotnet.fileBasedApps.enableAutomaticDiscovery": "Enables automatic discovery of C# file-based apps in the workspace.", From 08cdd4f196b82246a4f611eecb8bf884d0818021 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 14 Sep 2026 08:57:22 -0700 Subject: [PATCH 2/2] Test on-demand setting mapping Verify the Roslyn option name maps to the contributed VS Code setting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5615e2cd-8b86-40a5-808b-47f8fa893b35 --- .../lsptoolshost/unitTests/configurationMiddleware.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/lsptoolshost/unitTests/configurationMiddleware.test.ts b/test/lsptoolshost/unitTests/configurationMiddleware.test.ts index 759d8bc46..67cdf2d82 100644 --- a/test/lsptoolshost/unitTests/configurationMiddleware.test.ts +++ b/test/lsptoolshost/unitTests/configurationMiddleware.test.ts @@ -8,6 +8,7 @@ import { convertServerOptionNameToClientConfigurationName } from '../../../src/l import { describe, test, expect } from '@jest/globals'; const editorBehaviorSection = 1; +const lspServerSection = 3; const testData = [ { serverOption: 'csharp|symbol_search.dotnet_search_reference_assemblies', @@ -273,6 +274,12 @@ const testData = [ declareInPackageJson: true, section: editorBehaviorSection, }, + { + serverOption: 'projects.dotnet_load_on_demand', + vsCodeConfiguration: 'dotnet.projects.loadOnDemand', + declareInPackageJson: true, + section: lspServerSection, + }, ]; describe('Server option name to vscode configuration name test', () => {