Show read/write kind and let the panel filter on it
The reference request carries no read/write information, so derive it: - Classify every reference syntactically first — assignment and compound assignment, ++/--, and ref/out arguments are writes, everything else is a read. The suffix test only looks past the end of the reference, so the `=` in `previous = x` does not make the read of `x` look like a write. - Then ask textDocument/documentHighlight per file, whose Read/Write kinds override the syntactic answer. Plain Text highlights carry no kind and leave it standing, so servers without the feature still get a sensible column. Files have to be opened as text documents for the server to answer, so results spanning more than 60 files skip this step. In the panel: a sortable Kind column with read/write badges, All / Reads / Writes buttons, the kind included in the text filter, and a write count in the summary line. The kind filter is persisted with the rest of the view state. Line and Kind columns carry minimum widths that fit their own headers, which Line previously did not. Verified against DotRush on a field that is both read and written: the assignment and the `ref` argument classify as writes, the subscript, the comparison and the right-hand-side use as reads. The editor view does not mark writes yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+49
-1
@@ -3,7 +3,7 @@
|
||||
:root {
|
||||
--row-height: 22px;
|
||||
--header-height: 24px;
|
||||
--grid: var(--cr-grid, 40% 20% 56px 14% 20%);
|
||||
--grid: var(--cr-grid, 36% 18% 48px 56px 14% 20%);
|
||||
}
|
||||
|
||||
* {
|
||||
@@ -296,3 +296,51 @@ body.resizing {
|
||||
#empty[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* --- read / write ------------------------------------------------------- */
|
||||
|
||||
.segmented {
|
||||
display: flex;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.segmented .segment {
|
||||
border-radius: 0;
|
||||
border-right-width: 0;
|
||||
}
|
||||
|
||||
.segmented .segment:first-child {
|
||||
border-radius: 2px 0 0 2px;
|
||||
}
|
||||
|
||||
.segmented .segment:last-child {
|
||||
border-radius: 0 2px 2px 0;
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
.td.kind {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.kind-badge {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
padding: 0 5px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
font-size: 0.9em;
|
||||
line-height: 1.5;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.kind-read {
|
||||
color: var(--vscode-descriptionForeground);
|
||||
background: var(--vscode-badge-background);
|
||||
}
|
||||
|
||||
.kind-write {
|
||||
color: var(--vscode-inputValidation-warningForeground, var(--vscode-foreground));
|
||||
background: var(--vscode-inputValidation-warningBackground);
|
||||
border-color: var(--vscode-inputValidation-warningBorder, transparent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user