Hook up showing files in hidden folders in QuickOpen. (#2531)

* Hook up showing files in hidden folders in QuickOpen.

* Lets enable by default.
This commit is contained in:
Ryan C 2018-09-27 19:16:35 +01:00 committed by GitHub
parent 1f2c553709
commit 6af7221ae7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 5 deletions

View File

@ -145,6 +145,7 @@ const BaseConfiguration: IConfigurationValues = {
"editor.quickOpen.filterStrategy": "vscode",
"editor.quickOpen.defaultOpenMode": Oni.FileOpenMode.Edit,
"editor.quickOpen.alternativeOpenMode": Oni.FileOpenMode.ExistingTab,
"editor.quickOpen.showHidden": true,
"editor.split.mode": "native",

View File

@ -163,6 +163,7 @@ export interface IConfigurationValues {
"editor.quickInfo.delay": number
"editor.quickOpen.defaultOpenMode": Oni.FileOpenMode
"editor.quickOpen.alternativeOpenMode": Oni.FileOpenMode
"editor.quickOpen.showHidden": boolean
"editor.errors.slideOnFocus": boolean
"editor.formatting.formatOnSwitchToNormalMode": boolean // TODO: Make this setting reliable. If formatting is slow, it will hose edits... not fun

View File

@ -16,11 +16,12 @@ export function getCommand(): string {
return '"' + path.join(rootPath, executableName) + '"'
}
export function getArguments(excludePaths: string[]): string[] {
export function getArguments(excludePaths: string[], shouldShowHidden: boolean): string[] {
const ignoreArguments = excludePaths.reduce((prev, cur) => {
return prev.concat(["-g", "!" + cur])
}, [])
// TODO: Add option to enable "--hidden"
return ["--vimgrep"].concat(ignoreArguments)
const showHidden = shouldShowHidden ? ["--hidden"] : []
return ["--vimgrep"].concat(showHidden, ignoreArguments)
}

View File

@ -32,7 +32,10 @@ export class Search implements Oni.Search.ISearch {
const commandParts = [
RipGrep.getCommand(),
"--ignore-case",
...RipGrep.getArguments(configuration.getValue("oni.exclude")),
...RipGrep.getArguments(
configuration.getValue("oni.exclude"),
configuration.getValue("editor.quickOpen.showHidden"),
),
// "-e",
...(opts.fileFilter ? ["-g", opts.fileFilter] : []),
"--",
@ -45,7 +48,10 @@ export class Search implements Oni.Search.ISearch {
public findInPath(opts: Oni.Search.Options): Oni.Search.Query {
const commandParts = [
RipGrep.getCommand(),
...RipGrep.getArguments(configuration.getValue("oni.exclude")),
...RipGrep.getArguments(
configuration.getValue("oni.exclude"),
configuration.getValue("editor.quickOpen.showHidden"),
),
"--files",
"--",
opts.workspace ? opts.workspace : ".",