-
Notifications
You must be signed in to change notification settings - Fork 229
Uri Presentation Part 2, aka Cohost Html on-demand generation #10359
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
Changes from 15 commits
98ec289
6760ae2
b288eb0
3c84e65
957b833
5a67db7
ffb9ccc
ad16e26
ce3c26b
00ae336
17b2a93
d11f843
37552bf
8850129
6604eab
836ab71
d81c2ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,20 +5,13 @@ | |
| using System.IO; | ||
| using System.Linq; | ||
| using Microsoft.CodeAnalysis.Razor.Logging; | ||
| using Microsoft.CodeAnalysis.Razor.Protocol; | ||
|
|
||
| namespace Microsoft.CodeAnalysis.Razor.DocumentPresentation; | ||
|
|
||
| internal static class UriPresentationHelper | ||
| { | ||
| public static Uri? GetComponentFileNameFromUriPresentationRequest(RazorLanguageKind languageKind, Uri[]? uris, ILogger logger) | ||
| public static Uri? GetComponentFileNameFromUriPresentationRequest(Uri[]? uris, ILogger logger) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Observation: (nit since it is an internal API anyway, but) This API no longer takes language kind and seems like it is now HTML-specific. Your comments are at the caller level where you've moved this logic out to, but at the API level here, it is not obvious for someone looking at it later to know this is actually now HTML-specific (class or API or implementation doesn't make it obvious).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO it's quite the opposite. Except for the block of code I moved, the method has nothing to do with a specific language at all, its only job is to reason about the set of Uris passed in. What any caller chooses to do with the result is up to the caller. Thats why the language check was out of place. |
||
| { | ||
| if (languageKind is not RazorLanguageKind.Html) | ||
| { | ||
| // Component tags can only be inserted into Html contexts, so if this isn't Html there is nothing we can do. | ||
| return null; | ||
| } | ||
|
|
||
| if (uris is null || uris.Length == 0) | ||
| { | ||
| logger.LogDebug($"No URIs were included in the request?"); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.