diff --git a/webapp/packages/plugin-sql-editor/src/SqlEditor/SQLCodeEditorPanel/useSQLCodeEditorPanel.ts b/webapp/packages/plugin-sql-editor/src/SqlEditor/SQLCodeEditorPanel/useSQLCodeEditorPanel.ts index 6fa0fcb1bc..61e18f4683 100644 --- a/webapp/packages/plugin-sql-editor/src/SqlEditor/SQLCodeEditorPanel/useSQLCodeEditorPanel.ts +++ b/webapp/packages/plugin-sql-editor/src/SqlEditor/SQLCodeEditorPanel/useSQLCodeEditorPanel.ts @@ -258,15 +258,14 @@ export function useSQLCodeEditorPanel( proposals = proposals.filter( ({ displayString }) => ( - displayString.toLocaleLowerCase() !== word.toLocaleLowerCase() - && displayString.toLocaleLowerCase().startsWith(word.toLocaleLowerCase()) + word === '*' + || ( + displayString.toLocaleLowerCase() !== word.toLocaleLowerCase() + && displayString.toLocaleLowerCase().startsWith(word.toLocaleLowerCase()) + ) ) ); - // if (proposals.length === 0) { - // return; - // } - const hints: Hints = { from, to, @@ -276,6 +275,17 @@ export function useSQLCodeEditorPanel( })), }; + // fix single completion + if (proposals.length === 1 && options.completeSingle) { + editor.showHint({ + completeSingle: true, + updateOnCursorActivity: false, + closeCharacters, + hint: () => hints, + }); + return; + } + return hints; },