This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
streaming search: fix diff result highlighting #19543
Merged
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 #19403
Decided to go with a front-end only solution because we still need the full Markdown code indicators to determine file type for
SearchResultMatch.tsx
to know the contents are code and what type of code they are for syntax highlighting.There could be loads of ways to improve this in the future but this was the quickest relatively-clean solution to fix this bug now. In the future,
SearchResultMatch.tsx
could know that this is a diff/commit result and treat it in a more specialized way. Also, search results could be returned already syntax-highlighted so we don't have to call another API to get the highlighted code.Also fixes font color for search results without syntax highlighting (eg.
type:commit
)