Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoushik0 committed Oct 1, 2018
1 parent c9cc149 commit a9767b9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion extensions/search-rg/src/ripgrepTextSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ function getRgArgs(query: vscode.TextSearchQuery, options: vscode.TextSearchOpti
}

args.push('--no-config');
args.push('--no-ignore-global');
if (!options.useGlobalIgnoreFiles) {
args.push('--no-ignore-global');
}

// Folder to search
args.push('--');
Expand Down
7 changes: 7 additions & 0 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ declare module 'vscode' {
* See the vscode setting `"search.followSymlinks"`.
*/
followSymlinks: boolean;

/**
* Whether global files that exclude files, like .gitignore, should be respected.
* See the vscode setting `"search.useGlobalIgnoreFiles"`.
*/
useGlobalIgnoreFiles: boolean;

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,11 @@ configurationRegistry.registerConfiguration({
default: true,
scope: ConfigurationScope.RESOURCE
},
'search.useGlobalIgnoreFiles': {
type: 'boolean',
markdownDescription: nls.localize('useGlobalIgnoreFiles', "Controls whether to use global `.gitignore` and `.ignore` files when searching for files."),
default: false,
},
'search.quickOpen.includeSymbols': {
type: 'boolean',
description: nls.localize('search.quickOpen.includeSymbols', "Whether to include results from a global symbol search in the file results for Quick Open."),
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/services/search/node/ripgrepTextSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ function getRgArgs(config: IRawSearch) {
}

args.push('--no-config');
if (!config.ignoreGlobal) {
if (!config.useGlobalIgnoreFiles) {
args.push('--no-ignore-global');
}

Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/services/search/node/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface IRawSearch {
useRipgrep?: boolean;
disregardIgnoreFiles?: boolean;
previewOptions?: ITextSearchPreviewOptions;
ignoreGlobal?: boolean;
useGlobalIgnoreFiles?: boolean;
}

export interface ITelemetryEvent {
Expand Down

0 comments on commit a9767b9

Please sign in to comment.