Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
czgu committed Nov 19, 2024
1 parent d840712 commit cf8c7f1
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions querybook/webapp/components/QueryEditor/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,23 +294,28 @@ export const QueryEditor: React.FC<
const { extension: hoverTooltipExtension, getTableAtCursor } =
useHoverTooltipExtension({
codeAnalysisRef,
metastoreId: 1,
metastoreId,
language,
});

const openTableModalCommand = useCallback((editorView: EditorView) => {
const table = getTableAtCursor(editorView);
if (table) {
getTableByName(table.schema, table.name).then((tableInfo) => {
if (tableInfo) {
navigateWithinEnv(`/table/${tableInfo.id}/`, {
isModal: true,
});
}
});
}
return true;
}, []);
const openTableModalCommand = useCallback(
(editorView: EditorView) => {
const table = getTableAtCursor(editorView);
if (table) {
getTableByName(table.schema, table.name).then(
(tableInfo) => {
if (tableInfo) {
navigateWithinEnv(`/table/${tableInfo.id}/`, {
isModal: true,
});
}
}
);
}
return true;
},
[getTableAtCursor, getTableByName]
);

const keyBindings = useMemo(
() => [
Expand Down

0 comments on commit cf8c7f1

Please sign in to comment.