Преглед изворни кода

Closes #728 - Adds advanced.maxSearchItems

main
Eric Amodio пре 5 година
родитељ
комит
7bd929049f
5 измењених фајлова са 10 додато и 6 уклоњено
  1. +1
    -0
      README.md
  2. +6
    -0
      package.json
  3. +1
    -5
      src/commands/searchCommits.ts
  4. +1
    -0
      src/config.ts
  5. +1
    -1
      src/git/gitService.ts

+ 1
- 0
README.md Прегледај датотеку

@ -848,6 +848,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| `gitlens.advanced.caching.enabled` | Specifies whether git output will be cached — changing the default is not recommended |
| `gitlens.advanced.fileHistoryFollowsRenames` | Specifies whether file histories will follow renames -- will affect how merge commits are shown in histories |
| `gitlens.advanced.maxListItems` | Specifies the maximum number of items to show in a list. Use 0 to specify no maximum |
| `gitlens.advanced.maxSearchItems` | Specifies the maximum number of items to show in a search. Use 0 to specify no maximum |
| `gitlens.advanced.messages` | Specifies which messages should be suppressed |
| `gitlens.advanced.quickPick.closeOnFocusOut` | Specifies whether to close QuickPick menus when focus is lost |
| `gitlens.advanced.repositorySearchDepth` | Specifies how many folders deep to search for repositories |

+ 6
- 0
package.json Прегледај датотеку

@ -1668,6 +1668,12 @@
"markdownDescription": "Specifies the maximum number of items to show in a list. Use 0 to specify no maximum",
"scope": "window"
},
"gitlens.advanced.maxSearchItems": {
"type": "number",
"default": 200,
"markdownDescription": "Specifies the maximum number of items to show in a search. Use 0 to specify no maximum",
"scope": "window"
},
"gitlens.advanced.messages": {
"type": "object",
"default": {

+ 1
- 5
src/commands/searchCommits.ts Прегледај датотеку

@ -39,7 +39,6 @@ const searchByToSymbolMap = new Map([
export interface SearchCommitsCommandArgs {
search?: string;
searchBy?: GitRepoSearchBy;
maxCount?: number;
prefillOnly?: boolean;
showInView?: boolean;
@ -177,7 +176,6 @@ export class SearchCommitsCommand extends ActiveEditorCachedCommand {
if (args.showInView) {
void Container.searchView.search(repoPath, args.search, args.searchBy, {
maxCount: args.maxCount,
label: { label: searchLabel! }
});
@ -186,9 +184,7 @@ export class SearchCommitsCommand extends ActiveEditorCachedCommand {
const progressCancellation = CommitsQuickPick.showProgress(searchLabel!);
try {
const log = await Container.git.getLogForSearch(repoPath, args.search, args.searchBy, {
maxCount: args.maxCount
});
const log = await Container.git.getLogForSearch(repoPath, args.search, args.searchBy);
if (progressCancellation.token.isCancellationRequested) return undefined;

+ 1
- 0
src/config.ts Прегледај датотеку

@ -205,6 +205,7 @@ export interface AdvancedConfig {
};
fileHistoryFollowsRenames: boolean;
maxListItems: number;
maxSearchItems: number;
messages: {
suppressCommitHasNoPreviousCommitWarning: boolean;
suppressCommitNotFoundWarning: boolean;

+ 1
- 1
src/git/gitService.ts Прегледај датотеку

@ -1441,7 +1441,7 @@ export class GitService implements Disposable {
searchBy: GitRepoSearchBy,
options: { maxCount?: number } = {}
): Promise<GitLog | undefined> {
let maxCount = options.maxCount == null ? Container.config.advanced.maxListItems || 0 : options.maxCount;
let maxCount = options.maxCount == null ? Container.config.advanced.maxSearchItems || 0 : options.maxCount;
const similarityThreshold = Container.config.advanced.similarityThreshold;
let searchArgs: string[] | undefined = undefined;

Loading…
Откажи
Сачувај