From d08e214add0e2b601fb6c1d44945387b8d2e2585 Mon Sep 17 00:00:00 2001 From: arpitnath Date: Mon, 8 Apr 2024 10:57:50 +0530 Subject: [PATCH] fixes: cursor postion for selection hint --- .../src/Editor/CodeEditor/autocompleteExtensionConfig.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/Editor/CodeEditor/autocompleteExtensionConfig.js b/frontend/src/Editor/CodeEditor/autocompleteExtensionConfig.js index 8d034b9139..ab08f79e82 100644 --- a/frontend/src/Editor/CodeEditor/autocompleteExtensionConfig.js +++ b/frontend/src/Editor/CodeEditor/autocompleteExtensionConfig.js @@ -63,7 +63,7 @@ function orderSuggestions(suggestions, validationType) { return [...matchingSuggestions, ...otherSuggestions]; } -export const generateHints = (hints, isFxHinter = false, totalReferences = 1) => { +export const generateHints = (hints, totalReferences = 1) => { if (!hints) return []; const suggestions = hints.map(({ hint, type }) => { @@ -90,9 +90,7 @@ export const generateHints = (hints, isFxHinter = false, totalReferences = 1) => insert: completion.label, }; - let anchorSelection = isFxHinter - ? pickedCompletionConfig.insert.length - : pickedCompletionConfig.insert.length + 2; + let anchorSelection = pickedCompletionConfig.insert.length + 2; if (completion.type === 'js_methods') { pickedCompletionConfig.from = from;