Skip to content

Commit

Permalink
fix autocomplete (#19047)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh authored Mar 10, 2022
1 parent 0e0bece commit a21d8a0
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,17 @@ class AceEditorWrapper extends React.PureComponent<Props, State> {
meta: 'schema',
}));
const columns = {};
const tables = props.tables || [];
const extendedTables = props.extendedTables || [];
const tables = props.extendedTables || props.tables || [];

const tableWords = tables.map(t => {
const tableName = t.value;
const extendedTable = extendedTables.find(et => et.name === tableName);
const cols = (extendedTable && extendedTable.columns) || [];
const tableName = t.name;
const cols = t.columns || [];
cols.forEach(col => {
columns[col.name] = null; // using an object as a unique set
});

return {
name: t.label,
name: tableName,
value: tableName,
score: TABLE_AUTOCOMPLETE_SCORE,
meta: 'table',
Expand Down

0 comments on commit a21d8a0

Please sign in to comment.