mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-12 23:37:00 +08:00
fix(plugin-sql-editor): CB-1856 single completion
This commit is contained in:
+16
-6
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user