diff --git a/src/webviews/apps/shared/components/search/search-input.ts b/src/webviews/apps/shared/components/search/search-input.ts index 58c5a863e56f8..cadd94fb2a0e2 100644 --- a/src/webviews/apps/shared/components/search/search-input.ts +++ b/src/webviews/apps/shared/components/search/search-input.ts @@ -1,13 +1,42 @@ -import { attr, css, customElement, FASTElement, html, observable, ref, volatile } from '@microsoft/fast-element'; +import { attr, css, customElement, FASTElement, html, observable, ref, volatile, when } from '@microsoft/fast-element'; import type { SearchQuery } from '../../../../../git/search'; +import { debounce } from '../../../../../system/function'; import '../codicon'; +export type SearchOperators = + | '=:' + | 'message:' + | '@:' + | 'author:' + | '#:' + | 'commit:' + | '?:' + | 'file:' + | '~:' + | 'change:'; + +export type HelpTypes = 'message:' | 'author:' | 'commit:' | 'file:' | 'change:'; + +const operatorsHelpMap = new Map([ + ['=:', 'message:'], + ['message:', 'message:'], + ['@:', 'author:'], + ['author:', 'author:'], + ['#:', 'commit:'], + ['commit:', 'commit:'], + ['?:', 'file:'], + ['file:', 'file:'], + ['~:', 'change:'], + ['change:', 'change:'], +]); + // match case is disabled unless regex is true const template = html`