diff --git a/package.json b/package.json index 1e569666f..ca22abbeb 100644 --- a/package.json +++ b/package.json @@ -314,6 +314,11 @@ "type": "number", "default": 60, "description": "The time Visual Studio Code will wait for the OmniSharp server to start. Time is expressed in seconds." + }, + "omnisharp.maxProjectResults": { + "type": "number", + "default": 250, + "description": "The maximum number of projects to be shown in the 'Select Project' dropdown (maximum 250)." } } }, diff --git a/src/omnisharp/launcher.ts b/src/omnisharp/launcher.ts index 6aa655687..08074566a 100644 --- a/src/omnisharp/launcher.ts +++ b/src/omnisharp/launcher.ts @@ -41,10 +41,12 @@ export function findLaunchTargets(): Thenable { return Promise.resolve([]); } + const options = Options.Read(); + return vscode.workspace.findFiles( /*include*/ '{**/*.sln,**/*.csproj,**/project.json}', /*exclude*/ '{**/node_modules/**,**/.git/**,**/bower_components/**}', - /*maxResults*/ 100) + /*maxResults*/ options.maxProjectResults) .then(resources => { return select(resources, vscode.workspace.rootPath); }); diff --git a/src/omnisharp/options.ts b/src/omnisharp/options.ts index 48239a182..3b923c5ca 100644 --- a/src/omnisharp/options.ts +++ b/src/omnisharp/options.ts @@ -11,7 +11,8 @@ export class Options { public useMono?: boolean, public loggingLevel?: string, public autoStart?: boolean, - public projectLoadTimeout?: number) { } + public projectLoadTimeout?: number, + public maxProjectResults?: number) { } public static Read(): Options { // Extra effort is taken below to ensure that legacy versions of options @@ -35,7 +36,8 @@ export class Options { const autoStart = omnisharpConfig.get('autoStart', true); const projectLoadTimeout = omnisharpConfig.get('projectLoadTimeout', 60); + const maxProjectResults = omnisharpConfig.get('maxProjectResults', 250); - return new Options(path, useMono, loggingLevel, autoStart, projectLoadTimeout); + return new Options(path, useMono, loggingLevel, autoStart, projectLoadTimeout, maxProjectResults); } } \ No newline at end of file