Skip to content

Commit

Permalink
Merge branch 'devel' into 3911-ai-command
Browse files Browse the repository at this point in the history
  • Loading branch information
kseniaguzeeva authored Dec 30, 2024
2 parents af3895a + efd0be6 commit 930fde6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const CLOSE_CHARACTERS = /[\s()[\]{};:>,=\\*]/;
const COMPLETION_WORD = /[\w*]*/;

export function useSqlDialectAutocompletion(data: ISQLEditorData): [Compartment, Extension] {
const { closeCompletion, useEditorAutocompletion } = useComplexLoader(codemirrorComplexLoader);
const { closeCompletion, useEditorAutocompletion, insertCompletionText } = useComplexLoader(codemirrorComplexLoader);
const localizationService = useService(LocalizationService);
const optionsRef = useObjectRef({ data });

Expand Down Expand Up @@ -56,7 +56,9 @@ export function useSqlDialectAutocompletion(data: ISQLEditorData): [Compartment,
return [
...filteredProposals.map<SqlCompletion>(proposal => ({
label: proposal.displayString,
apply: proposal.replacementString,
apply: (view, completion, from, to) => {
view.dispatch(insertCompletionText(view.state, proposal.replacementString, proposal.replacementOffset, to));
},
boost: proposal.score,
icon: proposal.icon,
})),
Expand Down

0 comments on commit 930fde6

Please sign in to comment.