From f9d1b28296af42f487cff6e0b36f3c1192f93b4e Mon Sep 17 00:00:00 2001 From: trean Date: Mon, 26 Aug 2024 15:24:24 +0200 Subject: [PATCH] Filter empty suggestions (#217) * filter empty suggestions * npm audi fix --- package-lock.json | 17 ++++++++--------- .../CodeEditorWindow/config/Autocomplete.js | 16 +++++++++------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0558f241..ec8f4b9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6403,12 +6403,11 @@ ] }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "license": "MIT", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -13249,11 +13248,11 @@ "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==" }, "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "requires": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" } }, diff --git a/src/components/CodeEditorWindow/config/Autocomplete.js b/src/components/CodeEditorWindow/config/Autocomplete.js index ad0e5f1c..2738ac21 100644 --- a/src/components/CodeEditorWindow/config/Autocomplete.js +++ b/src/components/CodeEditorWindow/config/Autocomplete.js @@ -35,13 +35,15 @@ export const autocomplete = async (monaco, qdrantClient) => { let suggestions = autocomplete.completeRequestHeader(header); - suggestions = suggestions.map((s) => { - return { - label: s, - kind: 17, - insertText: s, - }; - }); + suggestions = suggestions + .filter((s) => s !== '') + .map((s) => { + return { + label: s, + kind: 17, + insertText: s, + }; + }); return { suggestions }; } else {