Skip to content

Support all search prefixes, add all: search and assembly/search-result commands - #749

Open
chamnan wants to merge 8 commits into
icsharpcode:masterfrom
chamnan:develop
Open

chamnan wants to merge 8 commits into
icsharpcode:masterfrom
chamnan:develop

Conversation

@chamnan

@chamnan chamnan commented Nov 13, 2026

Copy link
Copy Markdown

Summary

Search prefixes were parsed but then ignored: every search ran as a type/member search, so something like c:X-Api-Key (string literal) found nothing. This PR makes all prefixes work, adds an all: search, and adds a few commands for managing the assembly list and search results.

Each commit can be reviewed on its own:

  1. Upgrade to ICSharpCode.ILSpyX 11.2. ILSpyX now identifies bundled assemblies in packages by their package-relative path (e.g. lib/net10.0/Foo.dll). SingleThreadAssemblyList resolves by full entry path and falls back to the bare entry name for identifiers created by older versions.
  2. Search prefixes.
    • Honor c:, t:, m:, md:, f:, p:, e:, tm: and @.
    • Add namespace (n:) and assembly (a:, an:, af:) search.
    • Add all:, which runs the member, literal, namespace and assembly searches at once and de-duplicates the results (a method can match both by name and by a literal it contains).
    • Document all prefixes in the README.
    • Resource search (r:) is still unsupported because embedded resources have no node representation yet.
  3. Commands.
    • "Unload Assembly" is now available in the Command Palette and asks which assembly or package to unload.
    • New "Clear Assembly List" command unloads all assemblies and packages.
    • Search results view: each search can be removed (inline ×), and a title-bar action clears all of them.
    • Result node IDs now use an increasing counter, so they stay unique after a search is removed.
  4. Activity Bar. Moves the "ILSpy: Assemblies" view from the Explorer into its own ILSpy Activity Bar container. The view ID is unchanged, so all menus and commands keep working. This changes the default location for existing users; I'm happy to drop this commit if you'd rather keep the view in the Explorer.

Testing

  • Backend: 84/84 tests pass, including new search tests for t:, n:, a: (plain assembly and inside a NuGet package), innamespace: filtering and all: (literals, mixed result kinds, no duplicates, case-insensitive prefix). The ILSpyX upgrade commit was also tested on its own: 73/73 pass.
  • Extension: unit tests (13/13), type check and lint pass. New tests in SearchResultTreeProvider.test.ts cover removing a single search, clearing all searches, and result IDs staying unique after a removal.
  • Manual: built the VSIX and ran it in an isolated VS Code instance. Load and unload (from the tree and from the Command Palette picker) and Clear Assembly List were checked against the loaded-assemblies list.

🤖 Generated with Claude Code

Chamnan Nop and others added 8 commits November 13, 2026 14:14
Bundled assemblies in packages are now identified by their package-relative
path. Resolve them by full entry path, falling back to the bare entry name
for identifiers created by older versions.
- Honor search prefixes (c:, t:, m:, md:, f:, p:, e:, tm:, @) instead of
  always searching types and members
- Add namespace (n:) and assembly (a:, an:, af:) search
- Add all: prefix searching types, members, literals, namespaces and
  assemblies at once, without duplicate results
- Document search prefixes in the README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Show "Unload Assembly" in the Command Palette, asking which assembly
  or package to unload
- Add "Clear Assembly List" to unload all assemblies and packages
- Allow removing single searches from the search results view, or
  clearing all of them at once; keep result node IDs unique after removal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Resolve nested types below their declaring type, and give top-level
  type nodes for nested types the same parent token as member nodes, so
  tree node IDs match
- Reveal the tree's own node matching a search or analyzer result,
  instead of the result node, which differs e.g. in its display name
- Select the closest visible ancestor for results in hidden
  compiler-generated code, such as async state machines

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Show assemblies and packages below folder nodes for the folders
  containing them, compacting chains of folders (like VS Code's compact
  folders) and shortening the home directory to ~
- Sort folders and assemblies by name, folders first
- Expand only folders containing assemblies loaded by the user; folders
  with auto-loaded dependencies only start collapsed
- Keep revealing nodes working through the folder level
- Add setting ilspy.groupAssembliesByFolder (default: true) to switch
  back to the flat list

Folder nodes exist only in the extension's tree view, the backend
protocol is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Show the line of the match in search results: for literals the line
  using the literal, for type and member names usually the declaration.
  Opening a result selects the match. The search request takes an
  optional output language, results carry the match location in code of
  that language (new SearchResultNode with optional match). Lines are
  located for the first 100 results, using directives are skipped.
- Find numbers in string literals, too: c:401 finds 401 and "401".
  ILSpy searches a single number term as numeric constant only.
- Search the dependencies of loaded assemblies, recursively, except
  .NET framework assemblies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Decompiled C# and IL code now supports F12, Ctrl/Cmd+Click, Peek Definition
and Ctrl/Cmd+F12 on types, members, local variables and parameters.

The backend records the positions of symbol references while writing the
decompiled code (the code itself is unchanged) and caches recent documents.
New LSP requests ilspy/findDefinitions and ilspy/findImplementations resolve
the symbol at a position to its definition, either in the same document or
in the decompiled code of its tree node. Implementations come from the
"Implemented By"/"Overridden By" analyzers and derived types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant