Skip to content

Commit 85186bb

Browse files
committed
Add projectFilesExcludePattern option so that user have chance to change
it.
1 parent 745c352 commit 85186bb

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,11 @@
10101010
"default": true,
10111011
"description": "Specifies whether the OmniSharp server will be automatically started or not. If false, OmniSharp can be started with the 'Restart OmniSharp' command"
10121012
},
1013+
"omnisharp.projectFilesExcludePattern" :{
1014+
"type": "string",
1015+
"default": "**/node_modules/**,**/.git/**,**/bower_components/**",
1016+
"description": "The exclude pattern used by OmniSharp to find all project files."
1017+
},
10131018
"omnisharp.projectLoadTimeout": {
10141019
"type": "number",
10151020
"default": 60,

src/omnisharp/launcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export async function findLaunchTargets(options: Options): Promise<LaunchTarget[
6565

6666
const projectFiles = await vscode.workspace.findFiles(
6767
/*include*/ '{**/*.sln,**/*.slnf,**/*.csproj,**/project.json,**/*.csx,**/*.cake}',
68-
/*exclude*/ '{**/node_modules/**,**/.git/**,**/bower_components/**}');
68+
/*exclude*/ `{${options.projectFilesExcludePattern}}`);
6969

7070
const csFiles = await vscode.workspace.findFiles(
7171
/*include*/ '{**/*.cs}',

src/omnisharp/options.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class Options {
1212
public waitForDebugger: boolean,
1313
public loggingLevel: string,
1414
public autoStart: boolean,
15+
public projectFilesExcludePattern: string,
1516
public projectLoadTimeout: number,
1617
public maxProjectResults: number,
1718
public useEditorFormattingSettings: boolean,
@@ -93,6 +94,7 @@ export class Options {
9394

9495
const autoStart = omnisharpConfig.get<boolean>('autoStart', true);
9596

97+
const projectFilesExcludePattern = omnisharpConfig.get<string>('projectFilesExcludePattern', '**/node_modules/**,**/.git/**,**/bower_components/**');
9698
const projectLoadTimeout = omnisharpConfig.get<number>('projectLoadTimeout', 60);
9799
const maxProjectResults = omnisharpConfig.get<number>('maxProjectResults', 250);
98100
const defaultLaunchSolution = omnisharpConfig.get<string>('defaultLaunchSolution', '');
@@ -154,6 +156,7 @@ export class Options {
154156
waitForDebugger,
155157
loggingLevel,
156158
autoStart,
159+
projectFilesExcludePattern,
157160
projectLoadTimeout,
158161
maxProjectResults,
159162
useEditorFormattingSettings,

test/unitTests/Fakes/FakeOptions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export function getEmptyOptions(): Options {
1212
/* waitForDebugger */false,
1313
/* loggingLevel */"",
1414
/* autoStart */false,
15+
/* projectFilesExcludePattern */"",
1516
/* projectLoadTimeout */0,
1617
/* maxProjectResults */0,
1718
/* useEditorFormattingSettings */false,

0 commit comments

Comments
 (0)