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:
@@ -7,8 +7,9 @@ source file*, so your theme's grammar colors every line for free. File headers s
|
||||
(`.csproj`/`.fsproj`/`.vbproj`) and reference count; the referenced symbol is highlighted; line numbers are
|
||||
shown in the gutter.
|
||||
|
||||
**Panel view** shows the same results as a table with resizable, sortable columns — Code, File, Line, Project
|
||||
and Containing member — grouped by file, with a filter box. By default it docks in the **bottom panel**
|
||||
**Panel view** shows the same results as a table with resizable, sortable columns — Code, File, Line, Kind,
|
||||
Project and Containing member — grouped by file, with a filter box and a reads/writes filter. By default it
|
||||
docks in the **bottom panel**
|
||||
alongside Terminal and Problems, where a wide, short table reads best; you can drag it to either side bar,
|
||||
or set `coloredReferences.panelLocation` to put it in an editor group instead.
|
||||
|
||||
@@ -28,6 +29,10 @@ In the panel, a single click previews a reference without leaving the panel, `En
|
||||
it, arrow keys walk the list, `Ctrl+F` focuses the filter, and clicking a column header sorts by it. Drag a
|
||||
column edge to resize it; double-click the edge to reset it.
|
||||
|
||||
The **All / Reads / Writes** buttons filter by kind, and the summary line counts the writes. Kind also works in
|
||||
the text filter, so typing `write` narrows to writes as well. See *Known limitations* for where the kind comes
|
||||
from.
|
||||
|
||||
## Settings
|
||||
|
||||
- `coloredReferences.view` — which view `Find All References (Colored)` opens: `document` (default) or `panel`
|
||||
@@ -66,7 +71,12 @@ the expected results stay deterministic.
|
||||
server has analyzed it.
|
||||
- The panel's code column cannot use your theme's token colors: webviews are not given them as CSS variables.
|
||||
It approximates the stock Dark+/Light+ hues instead. Semantic tokens (roadmap 2) would replace this.
|
||||
- Read/write kind is not shown yet — no language server reports it through the standard reference request.
|
||||
- Read/write kind is not part of the reference request, so it is derived two ways. Every reference is first
|
||||
classified from the surrounding text (assignment and compound-assignment operators, `++`/`--`, `ref`/`out`
|
||||
arguments), then `textDocument/documentHighlight` is asked per file and its `Read`/`Write` kinds override
|
||||
that wherever the server has an opinion. Servers that answer with plain `Text` highlights, or not at all,
|
||||
leave the syntactic answer standing — which is good for straightforward code and can be wrong for exotic
|
||||
expressions. Results spanning more than 60 files skip the server round-trip entirely.
|
||||
- Some language servers try to attach to every document of their language, including the virtual one, and may
|
||||
log a harmless error about an unknown URI scheme.
|
||||
|
||||
@@ -76,4 +86,4 @@ the expected results stay deterministic.
|
||||
result sets, and remembering column layout per workspace rather than per panel
|
||||
2. Semantic token overlay via `vscode.provideDocumentSemanticTokens`
|
||||
3. Filter by project / exclude tests
|
||||
4. Optional DotRush fast path for containing member + read/write kind
|
||||
4. ~~Read/write kind~~ — done for the panel; the editor view does not mark writes yet
|
||||
|
||||
Reference in New Issue
Block a user