import*as Common from"../common/common.js";import*as Host from"../host/host.js";import*as i18n from"../i18n/i18n.js";import*as QuickOpen from"../quick_open/quick_open.js";import{FilteredUISourceCodeListProvider}from"./FilteredUISourceCodeListProvider.js";import{SourcesView}from"./SourcesView.js";const UIStrings={openFile:"Open file"},str_=i18n.i18n.registerUIStrings("sources/OpenFileQuickOpen.js",UIStrings),i18nLazyString=i18n.i18n.getLazilyComputedLocalizedString.bind(void 0,str_);let openFileQuickOpenInstance;export class OpenFileQuickOpen extends FilteredUISourceCodeListProvider{static instance(e={forceNew:null}){const{forceNew:i}=e;return openFileQuickOpenInstance&&!i||(openFileQuickOpenInstance=new OpenFileQuickOpen),openFileQuickOpenInstance}attach(){this.setDefaultScores(SourcesView.defaultUISourceCodeScores()),super.attach()}uiSourceCodeSelected(e,i,r){Host.userMetrics.actionTaken(Host.UserMetrics.Action.SelectFileFromFilePicker),e&&("number"===typeof i?Common.Revealer.reveal(e.uiLocation(i,r)):Common.Revealer.reveal(e))}filterProject(e){return!e.isServiceProject()}renderAsTwoRows(){return!0}}QuickOpen.FilteredListWidget.registerProvider({prefix:"",title:i18nLazyString(UIStrings.openFile),provider:OpenFileQuickOpen.instance});