Rider not highlighting `hx-controller` and `hx-action` attributes
See original GitHub issueI’m not sure if this is an Htmx.TagHelpers issue or a JetBrains Rider issue. I am using the Htmx.TagHelpers and they work great. Razor converts the following code into an hx-get="/actual/path/to/controller"
.
<select class="form-control custom-select"
asp-for="SchoolId"
asp-items="Model.Schools"
hx-get
hx-controller="SurveySubmissions"
hx-action="GetTeachersAjax"
hx-route-surveyId="@Model.SurveyId"
hx-route-currentTeacherSelection="@Model.TargetId"
hx-target="#teachers"
hx-indicator=".htmx-indicator">
<option value="">Select a School…</option>
</select>
However, Rider does not pick up the hx-controller
and hx-action
attributes as tag helper enhanced. Looking at the code for the tag helper, I see they are defined using square brackets.
[HtmlTargetElement("*", Attributes = "[hx-get]")]
[HtmlTargetElement("*", Attributes = "[hx-post]")]
[HtmlTargetElement("*", Attributes = "[hx-delete]")]
[HtmlTargetElement("*", Attributes = "[hx-put]")]
[HtmlTargetElement("*", Attributes = "[hx-patch]")]
public class HtmxUrlTagHelper : TagHelper
If I instead change my code to include the brackets, then Rider bolds the attributes but Razor no longer processes them.
<select class="form-control custom-select"
asp-for="SchoolId"
asp-items="Model.Schools"
[hx-get]
hx-controller="SurveySubmissions"
hx-action="GetTeachersAjax"
hx-route-surveyId="@Model.SurveyId"
hx-route-currentTeacherSelection="@Model.TargetId"
hx-target="#teachers"
hx-indicator=".htmx-indicator">
<option value="">Select a School…</option>
</select>
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Inspection Settings | JetBrains Rider Documentation
JetBrains Rider | Settings or Preferences | Editor | Inspection ... This option lets you enable or disable syntax highlighting scheme.
Read more >Code annotation attributes | JetBrains Rider Documentation
Annotations framework provides a number of attributes described below. ... A method that returns null if the parameter is null, // and not...
Read more >asp-controller and asp-action attributes not working
I am implementing a project in ASP.NET MVC Core. This does not fire: <a asp-controller="App" asp-action="Trips" class="btn btn- ...
Read more >Why does Rider think my controller methods are unused?
The application works fine, each of the individual endpoints does its job as expected when triggered by Postman, but for some reason the...
Read more >Rider, Windows, Resolve symbols between Editor and ...
I open my project on my Mac and Rider resolves all the symbols just fine. The Unity project itself compiles and runs just...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, works perfectly. Thanks!
@stevenbenitez HEY IT WORKS NOW!
v0.0.18
. Turns out I had to compileJetBrains.Annotations
into the assembly. The NuGet Package only works for local projects. Give it a try. I just did and it seems to work.