Add @Example tag support to AutoLISP doc comments#271
Merged
Conversation
Extends the comment parser, documentation presenter, and TextMate grammar to recognise @example tags with optional inline descriptions and fenced code blocks. Multiple @example entries per docstring are supported, and @ signs inside code fences are not misinterpreted as tags. Adds unit tests for parsing and hover-markdown rendering. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR extends AutoLISP doc comment support to include @Example tags, so that examples (including fenced code blocks) can be parsed from docstrings and rendered in hover/tooltips, while also updating the TextMate grammar to highlight the new tag.
Changes:
- Extend doc comment parsing to support multiple
@Exampleentries and ignore@tag parsing inside fenced example blocks. - Render
@Examplesections in hover markdown, including normalizing fenced blocks to use theautolisplanguage id. - Update TextMate grammar + add unit tests for parsing and hover markdown rendering.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| extension/syntaxes/autolisp.tmLanguage.json | Adds @EXAMPLE/@EXAMPLES to comment-block tag highlighting. |
| extension/src/parsing/comments.ts | Parses @Example sections (multiple entries) and tracks fenced blocks to avoid mis-parsing @ inside code. |
| extension/src/help/documentationPresenter.ts | Renders examples into hover markdown, injecting/normalizing autolisp fenced blocks. |
| extension/src/test/suite/parsing.comments.test.ts | Adds parsing coverage for inline description, fences, multiple examples, and @ inside fences. |
| extension/src/test/suite/providers.hoverProvider.test.ts | Adds hover-markdown verification for one-line examples and fenced examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The previous implementation stripped leading |/; characters from all example lines, which incorrectly removed semicolons from valid AutoLISP comment lines inside @example blocks (e.g. "; this is a comment"). Those characters were only needed to handle ;| / |; delimiter lines, but those lines always normalize to empty via normalizeComment() and are skipped before normalizeExampleLine() is ever called for value accumulation — making the stripping branch unreachable dead code. Simplified to only strip up to 4 spaces of block-comment indentation, preserving all content characters including ; and |. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LanDong-adsk
approved these changes
Mar 13, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Extends the comment parser, documentation presenter, and TextMate grammar to recognize @example tags with optional inline descriptions and fenced code blocks. Multiple @example entries per docstring are supported, and @ signs inside code fences are not misinterpreted as tags. Adds unit tests for parsing and hover-markdown rendering.
Objective
#267
Abstractions
Tests performed
verified @example tag in comment for function previews:
Screen shot