Skip to content

Commit fb8969d

Browse files
committed
fix: snippets insertion
1 parent 1fbb476 commit fb8969d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/containers/Tenant/Query/QueryEditor/YqlEditor.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,13 @@ export function YqlEditor({
9393
window.ydbEditor = editor;
9494
const keybindings = getKeyBindings(monaco);
9595
monaco.editor.registerCommand('insertSnippetToEditor', (_asessor, input: string) => {
96-
changeUserInput({input});
97-
dispatch(setIsDirty(false));
96+
//suggestController is not properly typed yet in monaco-editor package
97+
const contribution = editor.getContribution<any>('snippetController2');
98+
if (contribution) {
99+
editor.focus();
100+
editor.setValue('');
101+
contribution.insert(input);
102+
}
98103
});
99104

100105
if (window.api.codeAssist) {

0 commit comments

Comments
 (0)