feat: add hierarchy levels for custom anchor nesting#240
Open
vmikk wants to merge 6 commits intoStarlaneStudios:masterfrom
Open
feat: add hierarchy levels for custom anchor nesting#240vmikk wants to merge 6 commits intoStarlaneStudios:masterfrom
vmikk wants to merge 6 commits intoStarlaneStudios:masterfrom
Conversation
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 adds support for explicit hierarchy levels in anchor tags, allowing users to create structured TOC-like hierarchies. Previously, only region tags (like
SECTION) supported hierarchical nesting through their start/end pairs. Non-region anchors could only exist at the root level, which make impossible to create multi-level TOC structures with custom tags.To specify hierarchy level for a particular anchor, user should add
hierarchyLevelproperty to tag configuration. By default, non-region tags havehierarchyLevelof 1, and region tags maintain existing behavior.Configuration example:
{ "commentAnchors.tags.anchors": { "L1": { "scope": "workspace", "highlightColor": "#FF6B6B", "behavior": "anchor", "hierarchyLevel": 1 }, "L2": { "scope": "workspace", "highlightColor": "#4ECDC4", "behavior": "anchor", "hierarchyLevel": 2 }, }Test data:
Which should results into:

No breaking changes were made to existing API or behavior.