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.", 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', () => {