fix(oracle): refresh table hover metadata from local index
Closes #8056
This commit is contained in:
4 files changed
+109
-10
No files matched your search
@@ -2896,15 +2896,14 @@ async function resolveSqlHoverTooltip(currentView: EditorViewType, pos: number)
|
||||
|
||||
try {
|
||||
let hoverTables = cachedTables.filter((table) => hoverTableMatchesScope(table, hoverScope));
|
||||
if (hoverTables.length === 0) {
|
||||
const loadedTables = usesLocalOnlyCompletionMetadata()
|
||||
? connectionStore.lookupLocalCompletionTables(props.connectionId, hoverScope.database, tableLookupName, MAX_COMPLETION_TABLES, hoverScope.schema, hoverScope.catalog)
|
||||
: await connectionStore.listCompletionTables(props.connectionId, hoverScope.database, tableLookupName, MAX_COMPLETION_TABLES, hoverScope.schema, false, hoverScope.schema, hoverScope.catalog);
|
||||
hoverTables = scopeHoverTables(loadedTables, hoverScope);
|
||||
cachedTables = mergeCompletionTables(cachedTables, hoverTables);
|
||||
}
|
||||
|
||||
let table = matchTable(qualifiedTableLookup, hoverTables) ?? matchTable(tableLookupName, hoverTables) ?? matchTable(identifier, hoverTables) ?? matchTable(name, hoverTables);
|
||||
if (!table) {
|
||||
const localTables = connectionStore.lookupLocalCompletionTables(props.connectionId, hoverScope.database, tableLookupName, MAX_COMPLETION_TABLES, hoverScope.schema, hoverScope.catalog);
|
||||
const localHoverTables = scopeHoverTables(localTables, hoverScope);
|
||||
hoverTables = mergeCompletionTables(localHoverTables, hoverTables);
|
||||
cachedTables = mergeCompletionTables(localHoverTables, cachedTables);
|
||||
table = matchTable(qualifiedTableLookup, hoverTables) ?? matchTable(tableLookupName, hoverTables) ?? matchTable(identifier, hoverTables) ?? matchTable(name, hoverTables);
|
||||
}
|
||||
if (!table && !usesLocalOnlyCompletionMetadata()) {
|
||||
const loadedTables = await connectionStore.listCompletionTables(props.connectionId, hoverScope.database, tableLookupName, MAX_COMPLETION_TABLES, hoverScope.schema, false, hoverScope.schema, hoverScope.catalog);
|
||||
const remoteHoverTables = scopeHoverTables(loadedTables, hoverScope);
|
||||
|
||||
Reference in new issue
Block a user