From 7020e25256d7c942e8ad088c36c5e188198c4893 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 1 Nov 2023 09:23:28 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=92=9A=20Update=20package.json=20vers?= =?UTF-8?q?ion=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/vscode/package-lock.json | 4 ++-- extensions/vscode/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index dbad854204..955bf6b9c2 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.1.40", + "version": "0.1.41", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.1.40", + "version": "0.1.41", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 9f4e196646..a22aac863f 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -1,7 +1,7 @@ { "name": "continue", "icon": "media/icon.png", - "version": "0.1.40", + "version": "0.1.41", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From 20994cd4a139559ad265e0e936c57834cffb764d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B2=BD/DAXTF?= <82003678+Bogyie@users.noreply.github.com> Date: Thu, 2 Nov 2023 02:50:06 +0900 Subject: [PATCH 2/3] Fix query strip problem (#594) * add_func_remove_prefix_and_suffix_on_util * fix_query_strip_with_added_func --- .../continuedev/plugins/context_providers/dynamic.py | 4 ++-- .../continuedev/plugins/context_providers/search.py | 4 ++-- server/continuedev/plugins/context_providers/url.py | 4 ++-- server/continuedev/plugins/context_providers/util.py | 12 ++++++++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/server/continuedev/plugins/context_providers/dynamic.py b/server/continuedev/plugins/context_providers/dynamic.py index 5056762134..727b6aa8ce 100644 --- a/server/continuedev/plugins/context_providers/dynamic.py +++ b/server/continuedev/plugins/context_providers/dynamic.py @@ -4,7 +4,7 @@ from ...core.context import ContextProvider from ...core.main import ContextItem, ContextItemDescription, ContextItemId from ...libs.util.create_async_task import create_async_task -from .util import remove_meilisearch_disallowed_chars +from .util import remove_meilisearch_disallowed_chars, remove_prefix class DynamicProvider(ContextProvider, ABC): @@ -40,7 +40,7 @@ async def get_item(self, id: ContextItemId, query: str) -> ContextItem: if not id.provider_title == self.title: raise Exception("Invalid provider title for item") - query = query.lstrip(self.title + " ") + query = remove_prefix(text=query, prefix=self.title).strip() results = await self.get_content(query) ctx_item = self.BASE_CONTEXT_ITEM.copy() diff --git a/server/continuedev/plugins/context_providers/search.py b/server/continuedev/plugins/context_providers/search.py index 4c095aff37..5b4faa5b61 100644 --- a/server/continuedev/plugins/context_providers/search.py +++ b/server/continuedev/plugins/context_providers/search.py @@ -7,7 +7,7 @@ from ...core.main import ContextItem, ContextItemDescription, ContextItemId from ...libs.util.logging import logger from ...libs.util.ripgrep import get_rg_path -from .util import remove_meilisearch_disallowed_chars +from .util import remove_meilisearch_disallowed_chars, remove_prefix class SearchContextProvider(ContextProvider): @@ -80,7 +80,7 @@ async def get_item(self, id: ContextItemId, query: str) -> ContextItem: if not id.provider_title == self.title: raise Exception("Invalid provider title for item") - query = query.lstrip("search ") + query = remove_prefix(text=query, prefix="search").strip() results = await self._search(query) ctx_item = self.BASE_CONTEXT_ITEM.copy() diff --git a/server/continuedev/plugins/context_providers/url.py b/server/continuedev/plugins/context_providers/url.py index 1ed7c18e9f..a98d593991 100644 --- a/server/continuedev/plugins/context_providers/url.py +++ b/server/continuedev/plugins/context_providers/url.py @@ -6,7 +6,7 @@ from ...core.context import ContextProvider from ...core.main import ContextItem, ContextItemDescription, ContextItemId -from .util import remove_meilisearch_disallowed_chars +from .util import remove_meilisearch_disallowed_chars, remove_prefix class URLContextProvider(ContextProvider): @@ -92,7 +92,7 @@ async def get_item(self, id: ContextItemId, query: str) -> ContextItem: raise Exception("Invalid provider title for item") # Generate the dynamic item - url = query.lstrip("url ").strip() + url = remove_prefix(text=query, prefix="url").strip() if url is None or url == "": return None content, title = self._get_url_text_contents_and_title(url) diff --git a/server/continuedev/plugins/context_providers/util.py b/server/continuedev/plugins/context_providers/util.py index 61bea8aa26..4368a85629 100644 --- a/server/continuedev/plugins/context_providers/util.py +++ b/server/continuedev/plugins/context_providers/util.py @@ -3,3 +3,15 @@ def remove_meilisearch_disallowed_chars(id: str) -> str: return re.sub(r"[^0-9a-zA-Z_-]", "", id) + + +def remove_prefix(text: str, prefix: str) -> str: + if text.startswith(prefix): + return text[len(prefix):] + return text + + +def remove_suffix(text: str, suffix: str) -> str: + if text.endswith(suffix): + return text[:-len(suffix)] + return text From 9942fe9b837410830abec979d82e0f905b7a8140 Mon Sep 17 00:00:00 2001 From: Benedict Lee Date: Thu, 2 Nov 2023 02:51:47 +0900 Subject: [PATCH 3/3] Prevent duplicate calls to keyDown events due to IME (#592) When typing non-latin characters (such as Korean, Japanese or Chinese) in the MainInputWindow, the KeyDown event is called duplicately due to IME. As a result, non-latin character input does not work properly. --- gui/src/components/ComboBox.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gui/src/components/ComboBox.tsx b/gui/src/components/ComboBox.tsx index de2986b7f8..cb1aa36008 100644 --- a/gui/src/components/ComboBox.tsx +++ b/gui/src/components/ComboBox.tsx @@ -1107,6 +1107,11 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => { setInputFocused(false); }, onKeyDown: (event) => { + // Prevent duplicate calls to keyDown events due to IME. + if (isComposing) { + return; + } + dispatch(setBottomMessage(undefined)); if (event.key === "Enter" && event.shiftKey) { // Prevent Downshift's default 'Enter' behavior.