Skip to content

Commit f9026f4

Browse files
Cythia828liuxy0551
andauthored
fix: #219 show tables' all fields (#220) (#221)
Co-authored-by: 琉易 <liuxy0551@qq.com>
2 parents c662c47 + 6d79955 commit f9026f4

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

website/src/languages/helpers/completionService.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -304,19 +304,6 @@ const getColumnCompletions = async (
304304
const words = wordRanges.map((wr) => wr.text);
305305
const result: ICompletionItem[] = [];
306306

307-
// Extract already selected columns from QUERY_RESULT to filter them out
308-
const queryResultEntity = entities.find(
309-
(entity) => entity.entityContextType === EntityContextType.QUERY_RESULT
310-
) as CommonEntityContext | undefined;
311-
312-
const selectedColumns = new Set<string | languages.CompletionItemLabel>();
313-
queryResultEntity?.columns?.forEach((col) => {
314-
const columnName = col[AttrName.alias]?.text || getPureEntityText(col.text);
315-
if (columnName) {
316-
selectedColumns.add(columnName);
317-
}
318-
});
319-
320307
// All tables defined in the context
321308
const allTableDefinitionEntities =
322309
(entities?.filter(
@@ -511,18 +498,6 @@ const getColumnCompletions = async (
511498
}
512499
}
513500

514-
// Filter out already selected columns in QUERY_RESULT
515-
if (selectedColumns.size > 0) {
516-
return result.filter((item) => {
517-
const columnName =
518-
(item as EnhancedCompletionItem)._columnText ||
519-
(typeof item.label === 'string'
520-
? item.label
521-
: (item.label as EnhancedCompletionItem).label);
522-
return !selectedColumns.has(columnName);
523-
});
524-
}
525-
526501
return result;
527502
};
528503

0 commit comments

Comments
 (0)