You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to get the XREF gen tool running again. I'm moving it off of CORSPROXY (by tapping api/apibrowser/dotnet/search?api-version=0.2&search={API} and reading the ms.assetid value). CORSPROXY now requires an API key to work. I don't want to leach quota and show a poor security practice by adding the key to the request ($"https://corsproxy.io/?{encodedUrl}&key={KEY}") or use a hosted API for this tool.
These changes make the tool work by directly creating the XREF links using Regex. This isn't the most complete and elegant code, but further updates will need to wait. I'll list and remark on Copilot's last set of suggestions ...
Normalize constructor names to XREF constructor UIDs
Restore escaping for special characters in generated xrefs
Per recent remarks and PRs, the convention shifted to not encoding special characters. I don't think Copilot's concern about markdown rendering is a problem ... at least not here ... I'm not seeing these characters inside of angle brackets causing a markdown rendering problem in VSC.
Constructor display names include a separate constructor member name, for example System.Text.StringBuilder.StringBuilder(). Replacing only the parentheses produces System.Text.StringBuilder.StringBuilder.%23ctor*, but the overload UID is System.Text.StringBuilder.%23ctor*. This also affects constructors with parameters, such as those of HttpClient. Replace the final constructor-name segment together with its parameter list so the generated xrefs resolve.
Operator results (ItemType == "Operator") reach this fallback and retain their display signatures, including parameter lists. Those signatures are not XREF UIDs such as System.Decimal.op_Addition*, so the generated references do not resolve. Add operator-specific normalization that maps the displayed operator to its metadata op_* name and removes the parameter list, including handling conversion operators.
Normalize explicit interface implementations to XREF UIDs
Explicit interface implementations need more than generic-arity replacement. For example, System.Collections.Generic.List<T>.System.Collections.IList.IsReadOnly becomes System.Collections.Generic.List`1.System.Collections.IList.IsReadOnly, but its UID is System.Collections.Generic.List`1.System#Collections#IList#IsReadOnly. The copied reference therefore does not resolve. Normalize the explicit-interface portion using UID-specific separators and generic-argument notation, then encode it for use in the xref.
Restore escaping for special characters in generated xrefs
Restore special-character escaping after constructing the UID. Shared/ApiResult.razor inserts Link directly into the copyable Markdown xrefs, but generic types now contain literal backticks and method overloads contain literal asterisks. These characters can interfere with Markdown parsing instead of producing the intended reference. Apply the previous %60 and %2A replacements after normalization, for every result type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #673
I'd like to get the XREF gen tool running again. I'm moving it off of CORSPROXY (by tapping
api/apibrowser/dotnet/search?api-version=0.2&search={API}and reading thems.assetidvalue). CORSPROXY now requires an API key to work. I don't want to leach quota and show a poor security practice by adding the key to the request ($"https://corsproxy.io/?{encodedUrl}&key={KEY}") or use a hosted API for this tool.The tool is only used by me 🦖 now. It's on the repo because I provided it to MS as a GH Pages demo app for Blazor WebAssembly apps.
These changes make the tool work by directly creating the XREF links using Regex. This isn't the most complete and elegant code, but further updates will need to wait. I'll list and remark on Copilot's last set of suggestions ...
Doesn't seem correct from testing here.
True, but it will have to wait. Tracked by #675.
True, but it will have to wait. Tracked by #675.
Per recent remarks and PRs, the convention shifted to not encoding special characters. I don't think Copilot's concern about markdown rendering is a problem ... at least not here ... I'm not seeing these characters inside of angle brackets causing a markdown rendering problem in VSC.