feat(sql lab): enable ACE editor search in SQL editors (#19328)

This commit is contained in:
Diego Medina 2022-03-31 19:05:00 -04:00 committed by GitHub
parent ab3770667c
commit eab9388f7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -127,8 +127,6 @@ class AceEditorWrapper extends React.PureComponent<Props, State> {
}
onEditorLoad(editor: any) {
editor.commands.removeCommand('find');
editor.commands.addCommand({
name: 'runQuery',
bindKey: { win: 'Alt-enter', mac: 'Alt-enter' },

View File

@ -68,6 +68,7 @@ const aceModuleLoaders = {
'theme/textmate': () => import('brace/theme/textmate'),
'theme/github': () => import('brace/theme/github'),
'ext/language_tools': () => import('brace/ext/language_tools'),
'ext/searchbox': () => import('brace/ext/searchbox'),
};
export type AceModule = keyof typeof aceModuleLoaders;
@ -164,10 +165,11 @@ export const SQLEditor = AsyncAceEditor([
'mode/sql',
'theme/github',
'ext/language_tools',
'ext/searchbox',
]);
export const FullSQLEditor = AsyncAceEditor(
['mode/sql', 'theme/github', 'ext/language_tools'],
['mode/sql', 'theme/github', 'ext/language_tools', 'ext/searchbox'],
{
// a custom placeholder in SQL lab for less jumpy re-renders
placeholder: () => {

View File

@ -26,3 +26,4 @@ declare module 'brace/mode/javascript';
declare module 'brace/theme/textmate';
declare module 'brace/theme/github';
declare module 'brace/ext/language_tools';
declare module 'brace/ext/searchbox';