Repository navigation
[FEATURE] Introduce new code highlight default - #1410
Merged
Merged
Conversation
jaapio
force-pushed
the
feature/highlight-node
branch
from
October 4, 2026 20:08
b972209 to
f5391e5
Compare
jaapio
marked this pull request as ready for review
October 4, 2026 20:09
jaapio
force-pushed
the
feature/highlight-node
branch
from
October 4, 2026 20:09
f5391e5 to
509a388
Compare
Contributor
|
I think it would be good to add an integration test demonstrating the highlighter directive |
Before code highlight default could only be set with a directive in RST or via the default setting in the project config. This change introduces a new system to set the default language using a none printable node `HightlightNode` The added compiler pass will update all codenodes in the AST to have the default value which starts at the moment the highlightnode is detected. For backward compatibility the highlight directive still sets the default language on the parser context, but this will be removed in the future. Consumers of this method are recommented to switch to the new system by implementing the ConsumesDefaultHighlightLanguage interface. Nodes implementing this interface will automatically get the default language when one is set.
jaapio
force-pushed
the
feature/highlight-node
branch
from
October 6, 2026 19:22
509a388 to
5ab75d3
Compare
jaapio
enabled auto-merge
October 6, 2026 19:22
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.
Before code highlight default could only be set with a directive in RST or via the default setting in the project config. This change introduces a new system to set the default language using a none printable node
HightlightNodeThe added compiler pass will update all codenodes in the AST to have the default value which starts at the moment the highlightnode is detected.
For backward compatibility the highlight directive still sets the default language on the parser context, but this will be removed in the future. Consumers of this method are recommented to switch to the new system by implementing the ConsumesDefaultHighlightLanguage interface. Nodes implementing this interface will automatically get the default language when one is set.
See: #1411