Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StringSyntax to the RouteAttribute #57369

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Conversation

IEvangelist
Copy link
Member

Add StringSyntax to the RouteAttribute

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Consistent syntax highlighting of template/patterns for routes.

Description

I noticed when using the [Route("/orders/{orderId:int}")] attribute, as an example, doesn't display the same as when using the EndpointRouteBuilderExtensions APIs for Map* that accept a template/pattern.

Example MapGet — includes string syntax:

image

Example Route — doesn't include string syntax:

image

I think it would be great if we could also highlight routes when using the attribute. This PR adds the StringSyntax to decorate the template parameter to be highlighted like the method APIs.

Contributes to #44535

I noticed when using the `[Route("/orders/{orderId:int}")]` attribute, as an example, doesn't display the same as when using the `EndpointRouteBuilderExtensions` APIs for `Map*` that accept a template/pattern. I think it would be great if we could also highlight routes when using the attribute. This PR adds the `StringSyntax` to decorate the `template` parameter to be highlighted like the method APIs.
@IEvangelist IEvangelist requested a review from a team as a code owner August 16, 2024 16:13
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Aug 16, 2024
@amcasey
Copy link
Member

amcasey commented Aug 16, 2024

CI failures look unrelated - re-running.

@amcasey
Copy link
Member

amcasey commented Aug 19, 2024

Failures appear to be #57416.

@IEvangelist
Copy link
Member Author

Besides discovering unrelated testing issues/concerns, anything else you need from me on the PR @amcasey?

@amcasey
Copy link
Member

amcasey commented Aug 20, 2024

@IEvangelist Sorry, I'm just looking at builds - you'll want a sign-off from one of the blazor devs.

@amcasey
Copy link
Member

amcasey commented Aug 20, 2024

Oh, hey, it finally passed!

@IEvangelist IEvangelist merged commit 707068e into main Aug 20, 2024
26 checks passed
@IEvangelist IEvangelist deleted the add-stringsyntax-route branch August 20, 2024 18:53
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview1 milestone Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants