ASP.NET Endpoints
Search the endpoints of ASP.NET Core projects in VS Code, like Rider's Endpoints window.
Usage
| Where |
What it does |
Ctrl+Shift+Alt+E (or ASP.NET Endpoints: Search Endpoints) |
Lists every endpoint. Filters by route, verb, controller, action or file. |
| Paste a real URL into the search |
GET https://host/api/orders/123?x=1 finds GET /api/orders/{id:int}. Honors constraints (int, guid, bool, alpha, decimal...), optional and catch-all parameters. Literal routes rank above parameterized ones. If the URL carries a gateway/PathBase prefix (/gateway/api/...), leading segments are skipped and the separator says so. |
Ctrl+T |
Routes show up next to classes and methods (GET /api/products/{id}). |
| Explorer → Endpoints |
Project → controller → endpoint tree, colored by verb. Click opens the code; right click copies the route. |
The index updates itself when .cs/.csproj files change. Reindex Endpoints rebuilds it from scratch.
What is recognized
- Controllers: class-level
[Route] (several), [HttpGet/Post/Put/Delete/Patch/Head/Options] with and without template, several attributes in one section, method-level [Route] combined with a verb, [AcceptVerbs(..., Route = ...)], absolute routes (/x, ~/x), [NonAction], [ActionName], and the [controller], [action] (without Async suffix) and [area] tokens.
- Inheritance:
[Route] inherited from a base controller (in another file), actions of abstract bases exposed on every concrete controller, overrides in the derived class replacing the base action.
- Templates in constants:
const string / static readonly string, Class.Constant, nameof(X) and literal concatenation.
- Minimal APIs:
MapGet/Post/Put/Delete/Patch, MapMethods, Map("route", ...), MapHub<T>, MapHealthChecks, MapGroup prefixes held in variables or chained (app.MapGroup("/api").RequireAuthorization().MapGet(...)).
- Comments, strings (including interpolated and raw ones) and
#region/#if do not confuse the parser.
Known limitations: routes built at runtime, groups passed as parameters to extension methods (the group prefix is lost), interpolated constants ($"{Base}/x") and conventional routing (MapControllerRoute) are not resolved. An unresolved template shows up as {expression}.
Settings
aspnetEndpoints.exclude: globs to skip. The default covers bin, obj, node_modules, .git, .vs and .claude (git worktrees under .claude/worktrees would duplicate every endpoint).
Development
npm install
npm test # unit tests (parser, resolver, search, globs)
npm run test:integration # opens an isolated VS Code on test/fixtures/workspace
npm run smoke -- ~/src/my-api # runs against a real repository and cross-checks with grep
npm run package # tests + aspnet-endpoints.vsix
code --install-extension aspnet-endpoints.vsix
src/core/ does not depend on VS Code (testable with node --test). lexer.ts masks comments and strings; csharpParser.ts extracts classes, actions, minimal APIs and constants from one file; resolver.ts puts everything together (inheritance, constants, tokens); routeTemplate.ts and search.ts combine and match routes. The VS Code layer lives in src/*.ts.
| |