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>
Colored References
Find All References results shown the way Visual Studio does it — in two views.
Editor view (default) writes the results into a read-only virtual document in the same language as your
source file, so your theme's grammar colors every line for free. File headers show the containing project
(.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, 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.
Works with any language server that implements references: DotRush, C# Dev Kit, OmniSharp, TypeScript, Rust, Go, ...
Usage
| Action | How |
|---|---|
| Find references | Ctrl+Alt+F12 (Cmd+Alt+F12 on mac), right-click → Find All References (Colored), or the command palette |
| Pick a view explicitly | References: Find All References in Colored Editor / … in Results Panel |
| Switch the current results to the other view | Ctrl+Alt+Shift+F12, or the split icon in the tab bar |
| Go to a reference | Enter, F12, or Ctrl+Click on a result line. Enter on a file header opens the file. |
| Re-run the search | F5, or the refresh icon in the tab bar / panel toolbar |
In the panel, a single click previews a reference without leaving the panel, Enter or a double-click jumps to
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 viewFind All References (Colored)opens:document(default) orpanelcoloredReferences.panelLocation— where the panel opens:bottom(default, docked next to Terminal / Problems and draggable to a side bar),beside(editor group to the side), orbelow(editor group underneath, so the table is wide and short)coloredReferences.openBeside— open results beside the current editor (defaulttrue)coloredReferences.showProject— show the containing project in file headers (defaulttrue)coloredReferences.reuseTab— reuse one results tab/panel instead of opening a new one per search (defaulttrue)
Install
Either install the .vsix (Extensions view → … → Install from VSIX…) or open this folder in VS Code,
run npm install, and press F5 to launch an Extension Development Host.
Tests
npm test launches a real VS Code against a C# solution, waits for the language server to answer, and asserts
on the rendered results — that every displayed line maps back to the source line it claims, that navigation and
hover work, that the panel's rows highlight the right occurrence, and that the containing member resolves.
Point it at your own solution with COLORED_REFS_TEST_FOLDER:
COLORED_REFS_TEST_FOLDER=/path/to/solution npm test
The run opens a generated .code-workspace that pins DotRush to the solution found in that folder, so your
repository's own .vscode/settings.json is left alone. C# Dev Kit and OmniSharp are disabled for the run so
the expected results stay deterministic.
Known limitations
- Coloring in the editor view is TextMate-only (no semantic tokens), since language servers only serve semantic tokens for real files. Types and identifiers therefore look like they do in a freshly opened file before the 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 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/outarguments), thentextDocument/documentHighlightis asked per file and itsRead/Writekinds override that wherever the server has an opinion. Servers that answer with plainTexthighlights, 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.
Roadmap
Webview panel with resizable, sortable columns— done; missing: virtualized rendering for very large result sets, and remembering column layout per workspace rather than per panel- Semantic token overlay via
vscode.provideDocumentSemanticTokens - Filter by project / exclude tests
Read/write kind— done for the panel; the editor view does not mark writes yet