Skip to content

Commit

Permalink
Merge pull request #939 from filipw/feature/875
Browse files Browse the repository at this point in the history
Configurable project list cap
  • Loading branch information
DustinCampbell authored Nov 15, 2016
2 parents a4ea8d3 + b2b2b22 commit 86a6763
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)."
}
}
},
Expand Down
4 changes: 3 additions & 1 deletion src/omnisharp/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ export function findLaunchTargets(): Thenable<LaunchTarget[]> {
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);
});
Expand Down
6 changes: 4 additions & 2 deletions src/omnisharp/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,7 +36,8 @@ export class Options {
const autoStart = omnisharpConfig.get<boolean>('autoStart', true);

const projectLoadTimeout = omnisharpConfig.get<number>('projectLoadTimeout', 60);
const maxProjectResults = omnisharpConfig.get<number>('maxProjectResults', 250);

return new Options(path, useMono, loggingLevel, autoStart, projectLoadTimeout);
return new Options(path, useMono, loggingLevel, autoStart, projectLoadTimeout, maxProjectResults);
}
}

0 comments on commit 86a6763

Please sign in to comment.