Skip to content

Commit

Permalink
feat(sql lab): enable ACE editor search in SQL editors (#19328)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomedina248 committed Mar 31, 2022
1 parent ab37706 commit eab9388
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
4 changes: 3 additions & 1 deletion superset-frontend/src/components/AsyncAceEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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: () => {
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/src/types/brace.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit eab9388

Please sign in to comment.