From ef42f97944625fb185a4a37e39bf271dd7125e98 Mon Sep 17 00:00:00 2001 From: zhangbk1 Date: Sun, 7 Apr 2024 09:41:30 +0800 Subject: [PATCH] =?UTF-8?q?Optimize:=20=E4=BC=98=E5=8C=96=20QickPick=20?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E5=80=BC=E5=B1=95=E7=A4=BA=20(trim=20?= =?UTF-8?q?=E5=89=8D=E5=90=8E=E7=A9=BA=E6=A0=BC=E5=8F=8A=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ src/extension-handler/quick-pick-handler.ts | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65570a1..124e95c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --> +## [Unreleased] + +### Changed + +-- Optimize QickPick conversion value display (优化 QickPick 转换值展示) + ## 1.0.6 ### Added diff --git a/src/extension-handler/quick-pick-handler.ts b/src/extension-handler/quick-pick-handler.ts index 93d64be..ba2389f 100644 --- a/src/extension-handler/quick-pick-handler.ts +++ b/src/extension-handler/quick-pick-handler.ts @@ -55,10 +55,11 @@ function generateOptionsBasedOnText(text: string, eol: EOL): Array= QuickPickLabelMaxLength - ? (recommendItem.conversionText.substring(0, QuickPickLabelMaxLength - 3) + '...') - : recommendItem.conversionText, + label: conversionTextForDisplay.length >= QuickPickLabelMaxLength + ? (conversionTextForDisplay.substring(0, QuickPickLabelMaxLength - 3) + '...') + : conversionTextForDisplay, description: `转换为 ${recommendItem.transforTo.join(' / ')}`, detail: `关键词 ${recommendItem.keyword.join(' ')}`, value: recommendItem.conversionText,