Skip to content

Commit 9336244

Browse files
authored
Merge pull request #5382 from xieyubo/release
Add projectFilesIncludePattern & projectFilesExcludePattern options.
2 parents 55bc054 + dc861dc commit 9336244

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
@@ -1013,6 +1013,11 @@
10131013
"default": true,
10141014
"description": "Specifies whether the OmniSharp server will be automatically started or not. If false, OmniSharp can be started with the 'Restart OmniSharp' command"
10151015
},
1016+
"omnisharp.projectFilesExcludePattern" :{
1017+
"type": "string",
1018+
"default": "**/node_modules/**,**/.git/**,**/bower_components/**",
1019+
"description": "The exclude pattern used by OmniSharp to find all project files."
1020+
},
10161021
"omnisharp.projectLoadTimeout": {
10171022
"type": "number",
10181023
"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,
@@ -94,6 +95,7 @@ export class Options {
9495

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

98+
const projectFilesExcludePattern = omnisharpConfig.get<string>('projectFilesExcludePattern', '**/node_modules/**,**/.git/**,**/bower_components/**');
9799
const projectLoadTimeout = omnisharpConfig.get<number>('projectLoadTimeout', 60);
98100
const maxProjectResults = omnisharpConfig.get<number>('maxProjectResults', 250);
99101
const defaultLaunchSolution = omnisharpConfig.get<string>('defaultLaunchSolution', '');
@@ -157,6 +159,7 @@ export class Options {
157159
waitForDebugger,
158160
loggingLevel,
159161
autoStart,
162+
projectFilesExcludePattern,
160163
projectLoadTimeout,
161164
maxProjectResults,
162165
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)