Commit Graph
10 Commits
Author SHA1 Message Date
maxandClaude Fable 5.1 d61e018348 Panel view is the default
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169iPWwKHZoBTNN9qwXiwqk
2026-09-08 19:01:50 +02:00
maxandClaude Fable 5.1 23d9ba1fc9 Read and write badges as a matched coloured pair
Info hue for read, warning hue for write, both as tints. Read no longer
looks disabled next to write's alert box.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169iPWwKHZoBTNN9qwXiwqk
2026-09-08 18:59:33 +02:00
maxandClaude Fable 5.1 742788efa3 Opaque panel header and toolbar; explain empty results
The theme's table header colour is a translucent tint, so rows scrolling
underneath made the column bar unreadable. Paint it over the solid
editor background. An empty search now asks the .NET Solution Launcher
which projects the language server loaded and says so, with a reload
button, instead of a bare "No references found".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169iPWwKHZoBTNN9qwXiwqk
2026-09-08 18:53:22 +02:00
maxandClaude Opus 5 3df78ba490 Filter panel results by project and hide test code
Roadmap item 3. One Filters button opens a menu holding both, rather than
two more controls in a toolbar that is already crowded in a docked panel:

- Hide test code, with the count of test results.
- A checkbox per project with its result count, plus All / None.

The button shows how many filters are active and the summary line reads
"12 of 43 references" while anything is filtered. Projects are persisted as
an *exclusion* list, so a project that only appears in a later search shows
up instead of being silently hidden. Test hiding seeds from
coloredReferences.hideTests on first results, then follows the panel.

What counts as test code is coloredReferences.testPattern, a regular
expression matched against the workspace-relative path and against the
containing project name. Matching on names turned out to need care: the
first pattern classified Latest.cs as a test because "Latest" contains
"test". The built-in pattern now requires the name to start at a boundary,
or an uppercase T for the CamelCase FooTests.cs form, and covers test/tests
directories, Tests.cs, foo_test.go, test_foo.py, foo.spec.ts and projects
named Something.Tests. An invalid configured regex is reported once and
ignored rather than throwing per search.

These filters narrow the panel only; the editor view still lists everything.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0.1.0
2026-09-07 17:50:02 +02:00
maxandClaude Opus 5 3e8ece8ed7 Classify the panel's code column with real token types
The panel guessed that any capitalised identifier was a type, so
`Profiler.Frames.Count` came out as three type-coloured names where the
editor shows a class and two members. The semantic overlay already fetches
per-file tokens, so feed the same data to the webview.

- codeSpans() returns the server's token spans per referenced line in the
  row's own trimmed coordinates; rows carry them and the webview colours from
  them, mapping token type names to its palette. Fields, properties, events
  and methods share the member colour, as they do in the stock themes.
- The regex tokenizer stays as the fallback for servers that serve no
  semantic tokens, and coloredReferences.semanticTokens now gates both views
  rather than just the editor.

Colours are still the approximated Dark+/Light+ palette — a webview is not
given the theme's token colours — so only the editor view can be theme-exact.
The README says so instead of promising this would fix it.

Two things the new tests establish, both assumptions the code was already
making: all files in a result share the origin's legend, so decoding tokens
from every file against one legend is sound; and all 237 relocated tokens in
the Profiler search report the same type name as their source token.

Also relaxes an over-specific assertion: DotRush calls Profiler.Frames a
field, not a property. Either way it is a member, which is what matters.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 17:32:32 +02:00
maxandClaude Opus 5 2a1a2a329f Colour the editor view with relocated semantic tokens
The results document only ever got TextMate colouring, because a language
server will not serve semantic tokens for a `colored-refs` URI: there is no
file and no compilation behind it. So identifiers looked the way a C# file
does before the server has analysed it.

Instead of tokenizing anything ourselves, fetch the tokens for each *source*
file and move them:

- vscode.provideDocumentSemanticTokensLegend / provideDocumentSemanticTokens
  give the legend and the delta-encoded tokens for a real file. Neither is
  listed by getCommands(), so a test calls them to prove they exist rather
  than looking them up.
- Decode to absolute positions, keep the tokens on displayed lines, and shift
  each column by CODE_INDENT minus the stripped leading whitespace — the same
  mapping that places the highlight ranges. Re-encode with the source legend,
  so the type and modifier numbers stay meaningful.
- The legend is only known after a server answers, but
  registerDocumentSemanticTokensProvider wants it up front, so registration
  is deferred to the first search and redone if a later legend differs.
- Runs after the results are on screen and only changes colours, never text,
  so nothing waits on it. coloredReferences.semanticTokens turns it off;
  results over 40 files skip it.

Verified against DotRush: every relocated token covers exactly the text it
covered in the source file, and `Profiler` comes back typed as `class`.

README: drops the claim that semantic tokens would fix the panel's colours.
They supply the classification, never the colours, and webviews are not given
theme token colours — so only the editor view can be theme-exact. Feeding the
panel real token types is now roadmap item 5.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 17:21:59 +02:00
maxandClaude Opus 5 864f4c2c5f Mark write references in the editor view too
Kinds now live on the display ranges rather than in a side map, so the
virtual document can paint reads and writes differently.

- ResultLine.symbolRanges becomes DisplayRange[] carrying start, end, the
  source column and the kind. displayLine() classifies syntactically as it
  renders, so the write markers are correct on the very first paint and the
  document never waits on a language server. refineKinds() then applies
  documentHighlight results and re-decorates; only decorations change, never
  the text, and a superseded tab is left alone.
- Writes get the theme's editor.wordHighlightStrong colours plus bold, which
  is what the editor itself uses for a write occurrence, so the two kinds are
  distinguishable in any theme. Reads keep the find-match highlight.
- DisplayRange.sourceCol replaces the arithmetic that recovered a source
  column by shifting relative to the first reference on the line. Covered by
  a new test that walks every occurrence on a line holding two references to
  the same symbol and checks each one navigates to its own column.

Also drops a stale assertion: an empty kind map used to mean "everything
reads", and now means "use the syntactic classification", so buildRows()
without a map is expected to report writes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 16:58:25 +02:00
maxandClaude Opus 5 9b2dbc4522 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>
2026-09-07 16:49:42 +02:00
maxandClaude Opus 5 92ff02f7ff Dock the results table in the bottom panel
createWebviewPanel only ever lives in the editor area, so the table could
not be dragged next to Terminal / Problems. A WebviewView can, and it can
also be dragged to either side bar.

- Extract ResultsView: the table's html, messaging, row building and
  navigation, independent of what hosts the webview. ReferencePanel keeps
  hosting it in an editor group; ReferenceViewProvider hosts it in a
  contributed panel view container. Results that arrive before the docked
  view has been resolved are queued and applied on resolve.
- coloredReferences.panelLocation selects the placement: bottom (default),
  beside, or below. "below" makes the editor row first so the table is wide
  and short, which suits the column layout better than a tall narrow group.
- sourceColumn() now ignores editors with no view column, so opening a
  reference from the docked view lands in a real editor group.
- toggleView and the refresh button work from either host.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 16:23:02 +02:00
maxandClaude Opus 5 2398b6b2ce Colored References: fix broken navigation, add sortable results panel
The extension shows Find All References results in a syntax-highlighted
virtual document. Two things were wrong and roadmap item 1 was missing.

Fixes, all reproduced against a real C# solution with DotRush:

- Navigation and hover were dead on every result. setTextDocumentLanguage()
  closes and re-opens the document under the same URI, which fired
  onDidCloseTextDocument and dropped the results from the store. The text
  still rendered because VS Code caches the model, so the pane looked
  correct while Enter / F12 / Ctrl+Click / hover all returned nothing.
  The virtual URI now carries the source file's extension so VS Code infers
  the language without recreating the document, and a close only discards
  results once no tab or document for that URI remains.
- reuseTab never reused: the symbol name is part of the URI, so every new
  symbol opened another tab. The previous results tab is now closed and its
  group taken over.
- The reference count in the title double-counted when two language servers
  answer the same request (DotRush plus C# Dev Kit). It now comes from the
  de-duplicated set.
- A results tab hidden behind another editor was duplicated into a new group
  instead of being revealed.
- Decorations are reapplied on active-editor change; a results tab restored
  from a previous window is closed instead of left as a dead empty document;
  searching with no symbol under the cursor no longer searches for "symbol".

Roadmap item 1 - webview results panel:

- Shared gathering, grouping and rendering moved to references.ts so both
  views work from the same data.
- panel.ts plus media/ render the results as a table with resizable,
  sortable Code / File / Line / Project / Containing member columns,
  collapsible per-file groups, a filter box, keyboard navigation, and
  single-click preview versus Enter to jump. Column widths default to a
  share of the panel width until dragged.
- Containing member comes from executeDocumentSymbolProvider, nested types
  included.
- coloredReferences.view selects the default view; toggleView switches the
  current results between the two.

Adds an integration suite that launches a real VS Code against a C#
solution and asserts on the rendered output, including that every displayed
line maps back to the source line it claims.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 16:17:08 +02:00