Файли
openidea/src/features/debugger/ui/TableViewDialog.module.css
T
LU XIANGRUIтаwildcatDownstairs 88f494ca50 feat(debugger): view pandas and numpy values as a table (#5166)
In a Python debug session, a DataFrame, Series or ndarray variable or watch only showed a one-line repr. It now has View as Table in its context menu: a resizable window with column headers (with dtypes for a DataFrame), the index, the shape, and pagers for rows (100 per page) and columns (30 per page). Each page is one `evaluate` in the paused frame: a small helper slices the object in the debuggee and returns only that page as JSON, so the whole object never goes over DAP. The expression can be edited (e.g. `a[0]` for a 3-D array), and the window stays open across steps, refreshing after each step or frame change.

Closes #5165

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-22 14:31:17 +08:00

116 рядки
1.9 KiB
CSS

.dialog {
height: clamp(320px, 60vh, 760px);
}
/* The table scrolls under a fixed bar, not the whole dialog body. */
.content {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
}
.bar {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-2);
padding-bottom: var(--space-2);
}
.expression {
flex: 1 1 200px;
min-width: 0;
height: var(--h-list-row);
padding: 0 6px;
font-family: var(--font-mono);
font-size: var(--fs-ui);
color: var(--fg);
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: var(--radius-small);
}
.expression:focus {
outline: none;
border-color: var(--focus-ring);
}
.summary,
.pager {
color: var(--fg-secondary);
white-space: nowrap;
}
.pager {
display: inline-flex;
align-items: center;
gap: var(--space-1);
}
.scroll {
flex: 1;
min-height: 0;
overflow: auto;
box-shadow: inset 0 0 0 1px var(--border);
border-radius: var(--radius-small);
}
.table {
border-collapse: separate;
border-spacing: 0;
font-family: var(--font-mono);
font-size: var(--fs-ui);
color: var(--fg);
}
.table th,
.table td {
height: var(--h-list-row);
padding: 0 8px;
white-space: pre;
border-right: 1px solid var(--border);
border-bottom: 1px solid var(--border);
}
.table thead th {
position: sticky;
top: 0;
z-index: 1;
text-align: left;
font-weight: normal;
color: var(--fg-secondary);
background: var(--bg-island);
}
.table .index {
position: sticky;
left: 0;
text-align: right;
font-weight: normal;
color: var(--fg-secondary);
background: var(--bg-island);
}
.table thead .index {
z-index: 2;
}
.table tbody tr:hover td {
background: var(--bg-hover);
}
.numeric {
text-align: right;
}
.dtype {
margin-left: var(--space-1);
color: var(--fg-subtle);
}
.message {
padding: var(--space-3) 0;
color: var(--fg-secondary);
}