From f45463d889b571a25dc53edcf80b4a8f427837d3 Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:40:17 +0530 Subject: [PATCH] Multi reference autocomplete fix (#2500) --- .../src/AppBuilder/CodeEditor/autocompleteExtensionConfig.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/AppBuilder/CodeEditor/autocompleteExtensionConfig.js b/frontend/src/AppBuilder/CodeEditor/autocompleteExtensionConfig.js index 3a4f2cf38e..e1d597c957 100644 --- a/frontend/src/AppBuilder/CodeEditor/autocompleteExtensionConfig.js +++ b/frontend/src/AppBuilder/CodeEditor/autocompleteExtensionConfig.js @@ -124,9 +124,7 @@ export const generateHints = (hints, totalReferences = 1, input, searchText) => const multiReferenceInSingleIndentifier = totalReferences == 1 && searchText !== currentWord; if (multiReferenceInSingleIndentifier) { - const splitAtSearchString = doc.toString().split(searchText)[0]; - const newFrom = splitAtSearchString.length; - + const newFrom = to - searchText.length; pickedCompletionConfig.from = newFrom; } else if (totalReferences > 1 && completion.type !== 'js_methods') { const splitIndex = from;