Skip to content

Commit ace6371

Browse files
committed
fix bug with ref formatting
1 parent 31f3428 commit ace6371

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/chat/context.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ export async function parsePromptForRefs(stream: vscode.ChatResponseStream, prom
4848
const tables: TableRefs = {};
4949
for (const word of prompt) {
5050
const [schema, table] = word.split(`.`);
51-
if (schema && table) {
52-
stream.progress(`looking up information for ${schema}.${table}`)
53-
const data = await getTableMetaData(schema, table);
54-
tables[table] = tables[table] || [];
55-
tables[table].push(...data);
51+
const cleanedTable = table.replace(/[,\/#!?$%\^&\*;:{}=\-_`~()]/g, "");
52+
if (schema && cleanedTable) {
53+
stream.progress(`looking up information for ${schema}.${cleanedTable}`)
54+
const data = await getTableMetaData(schema, cleanedTable);
55+
tables[cleanedTable] = tables[cleanedTable] || [];
56+
tables[cleanedTable].push(...data);
5657
}
5758
}
5859
return tables;

0 commit comments

Comments
 (0)