Colorize gensyms in inline macro expansions - #3977
Merged
Merged
Conversation
Each distinct gensym (`x__42__auto__', `G__17') in an expansion gets its own color from `cider-macrostep-gensym-colors', shared across all its occurrences, so a binding the macro introduced can be tracked through the result. Toggle with `cider-macrostep-color-gensyms'. Also dedupe the highlight overlays in both the gensym and expandable-head refresh paths: nested expansions overlap (the outer overlay still spans the inner text), so each token was scanned once per containing overlay and got a duplicate overlay every refresh.
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.
Phase 3 of the inline macrostep work (#1850): color the gensyms a macro introduces so you can track them through the expansion.
Each distinct gensym (
x__42__auto__,G__17) gets its own color fromcider-macrostep-gensym-colors, shared across all its occurrences - so a single binding the macro introduced is easy to follow from itslet/fnsite to every use. Toggle withcider-macrostep-color-gensyms(on by default). Only the unambiguous gensym shapes are colored (auto-gensyms and(gensym)output);(gensym "prefix")results are indistinguishable from ordinary symbols and left alone.While here, fixed a latent double-overlay bug the reviewer caught: nested expansions overlap (the outer overlay still spans the inner text), so each token was being scanned once per containing overlay and accumulating duplicate highlight overlays on every refresh. Both the gensym and the expandable-head (#3976) paths now dedupe by position.
Still on the macrostep Phase 3 list and deliberately not here: actually expanding inline functions (the classify op tags them, but that needs new backend support).