Fix syntax highlighting in the trace explorer - #36
Closed
VojtechStep wants to merge 3 commits into
Closed
Conversation
Removing shiki's built-in language grammars lead to it failing to initialize, so syntax highlighting in the trace explorer never worked. This is fixed by passing it the elpi grammar during initialization
The terrible performance was caused by not batching the redrawing of cards when the syntax information was updated. This is because each card's highlighting info was passed in a separate message, which are processed in different ticks, so every card caused a redraw. Here we add manual batching, so that the cards are all updated in the same tick.
Contributor
|
Damn, I'm sorry, syntax highlight has been broken for so long that I junked it this morning. I will look into this pr, but frankly I never found it very useful, even when it did work. |
Contributor
Author
|
I agree with you that it doesn't do much, so I opened #39 to clean up the removal instead |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR fixes two issues: the syntax highlighting did not work at all (the code fragments would always render as
undefined), and when I fixed it the performance was terrible.Shiki support was removed literally an hour ago, but maybe we can bring it back, since this just works? The upstream commit removes shiki and adds support for new trace versions in the same commit, I can split it (and implement backwards compatibility differently, as I mentioned in LPCIC/elpi#424 (comment))
Fixes #7