Skip to content

Commit c6c8860

Browse files
kburtramclaude
andauthored
Fix VECTOR(n) columns rendering as JSON hyperlinks in results grid (#21835)
VECTOR values like [0.1,2,30] are valid JSON arrays, so the per-cell JSON detection in getColumnFormatter was marking them as isJson=true and rendering them blue/clickable. Add isVector to IDbColumn (populated from DbColumnWrapper.IsVector in sqltoolsservice) and use it in getColumnFormatter to return textFormatter directly, bypassing the XML/JSON sampling path entirely. Fixes: #21806 Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent aa64d1e commit c6c8860

4 files changed

Lines changed: 9 additions & 0 deletions

File tree

extensions/mssql/src/models/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export interface IDbColumn {
126126
dataType: string;
127127
isXml?: boolean;
128128
isJson?: boolean;
129+
isVector?: boolean;
129130
isLong?: boolean;
130131
isReadOnly?: boolean;
131132
isUnique?: boolean;

extensions/mssql/src/sharedInterfaces/queryResult.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export interface IDbColumn {
173173
dataType: string;
174174
isXml?: boolean;
175175
isJson?: boolean;
176+
isVector?: boolean;
176177
isLong?: boolean;
177178
isReadOnly?: boolean;
178179
isUnique?: boolean;

extensions/mssql/src/webviews/pages/QueryResult/resultGrid.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,12 @@ function getColumnFormatter(columnInfo: qr.IDbColumn): (
362362
return hyperLinkFormatter;
363363
}
364364

365+
// VECTOR columns display as plain text. Their [n,n,n] format looks like a JSON array
366+
// but must never be formatted as a JSON hyperlink or opened in the JSON viewer.
367+
if (columnInfo.isVector) {
368+
return textFormatter;
369+
}
370+
365371
// Avoid expensive XML/JSON parsing on every cell render for plain-text columns.
366372
// Track which rows we've already sampled so SlickGrid re-renders don't
367373
// exhaust the budget.

extensions/mssql/typings/vscode-mssql.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,6 +2708,7 @@ declare module "vscode-mssql" {
27082708
dataType: string;
27092709
isXml?: boolean;
27102710
isJson?: boolean;
2711+
isVector?: boolean;
27112712
isLong?: boolean;
27122713
isReadOnly?: boolean;
27132714
isUnique?: boolean;

0 commit comments

Comments
 (0)