Go To PartialA VS Code extension that adds Go to Definition (F12 / Ctrl+Click) support for Razor partial view references in Features
InstallationFrom the VS Code MarketplaceSearch for Go To Partial in the VS Code Extensions panel, or install directly: From a
|
| Pattern | Navigable part |
|---|---|
@Html.Partial("_Name") |
"_Name" |
@Html.PartialAsync("_Name") |
"_Name" |
@await Html.PartialAsync("_Name") |
"_Name" |
@Html.RenderPartial("_Name") |
"_Name" |
@Html.RenderPartialAsync("_Name") |
"_Name" |
<partial name="_Name" /> |
"_Name" |
| Custom tag helpers | configurable via goToPartial.additionalTagHelperAttributes |
Both short names ("_MyPartial") and tilde-rooted paths ("~/Views/Shared/_MyPartial.cshtml") are supported.
View resolution order
When a short name like "_MyPartial" is used, the extension searches in this order:
- Same folder as the current file
Views/Shared/Views/Partials/Pages/Shared/Areas/{areaName}/Views/Shared/(if the current file is inside an Area)
The extension tries both with and without the .cshtml extension.
Settings
See docs/configuration.md for the full settings reference.
| Setting | Type | Default | Description |
|---|---|---|---|
goToPartial.additionalTagHelperAttributes |
string[] |
[] |
Extra HTML attribute names whose values should be treated as partial view names |
goToPartial.additionalPartialTagNames |
string[] |
[] |
Custom element names (e.g. ec-partial) that use a name attribute to reference a partial view |
Contributing
See docs/contributing.md for development setup, commit conventions, and the release process.
License
MIT