Skip to content

Commit 1c3c5b3

Browse files
committed
Refactor allTableNameCombinations to getFullyQualifiedTableName
1 parent 241b522 commit 1c3c5b3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/server/src/complete/candidates/createTableCandidates.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import { ICONS } from '../CompletionItemUtils'
99
* @param table
1010
* @returns
1111
*/
12-
function allTableNameCombinations(table: Table): string[] {
13-
if (table.catalog) {
14-
return [table.catalog + '.' + table.database + '.' + table.tableName]
12+
function getFullyQualifiedTableName(table: Table): string {
13+
if (table.catalog && table.database) {
14+
return table.catalog + '.' + table.database + '.' + table.tableName
1515
}
1616
if (table.database) {
17-
return [table.database + '.' + table.tableName]
17+
return table.database + '.' + table.tableName
1818
}
19-
return [table.tableName]
19+
return table.tableName
2020
}
2121

2222
export function createTableCandidates(
@@ -37,7 +37,7 @@ export function createTableCandidates(
3737
const qualificationLevelNeeded = qualificationNeeded - qualificationLevel
3838
switch (qualificationLevelNeeded) {
3939
case 0:
40-
return allTableNameCombinations(table)
40+
return [getFullyQualifiedTableName(table)]
4141
case 1:
4242
if (table.catalog && table.database) {
4343
return [table.catalog + '.' + table.database]

0 commit comments

Comments
 (0)