UNPKG

sussudio

Version:

An unofficial VS Code Internal API

55 lines (54 loc) 2 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Schemas } from "../../../common/network.mjs"; export const NO_KEY_MODS = { ctrlCmd: false, alt: false }; export var QuickInputHideReason; (function (QuickInputHideReason) { /** * Focus moved away from the quick input. */ QuickInputHideReason[QuickInputHideReason["Blur"] = 1] = "Blur"; /** * An explicit user gesture, e.g. pressing Escape key. */ QuickInputHideReason[QuickInputHideReason["Gesture"] = 2] = "Gesture"; /** * Anything else. */ QuickInputHideReason[QuickInputHideReason["Other"] = 3] = "Other"; })(QuickInputHideReason || (QuickInputHideReason = {})); export var ItemActivation; (function (ItemActivation) { ItemActivation[ItemActivation["NONE"] = 0] = "NONE"; ItemActivation[ItemActivation["FIRST"] = 1] = "FIRST"; ItemActivation[ItemActivation["SECOND"] = 2] = "SECOND"; ItemActivation[ItemActivation["LAST"] = 3] = "LAST"; })(ItemActivation || (ItemActivation = {})); export class QuickPickItemScorerAccessor { options; constructor(options) { this.options = options; } getItemLabel(entry) { return entry.label; } getItemDescription(entry) { if (this.options?.skipDescription) { return undefined; } return entry.description; } getItemPath(entry) { if (this.options?.skipPath) { return undefined; } if (entry.resource?.scheme === Schemas.file) { return entry.resource.fsPath; } return entry.resource?.path; } } export const quickPickItemScorerAccessor = new QuickPickItemScorerAccessor(); //#endregion