-
Notifications
You must be signed in to change notification settings - Fork 0
Add comment code blocks for documentation #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: andorthehood <[email protected]>
Co-authored-by: andorthehood <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot This helper is too generic to be under shaderUtils, let's move it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to pureHelpers/codeParsers/getBlockType.ts in commit 98e32d6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot I believe that this utils doesn't need to know about comment type code block because we don't send comments to the compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted to original state (without comment type support) in commit 98e32d6. The compiler now only knows about module, config, function, constants, and unknown types.
Co-authored-by: andorthehood <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a dedicated comment block type for long-form documentation that persists in projects but is excluded from compilation. Users can now create standalone documentation blocks through a new "New Comment" context menu option without resorting to dummy modules or semicolon comments.
Key Changes
- Added
'comment'to theCodeBlockTypeunion type and extended block detection logic to recognizecomment/commentEndmarkers with complete mutual exclusion - Refactored
getBlockTypefromshaderUtilstocodeParsersdirectory for better organization and updated all imports - Comment blocks are automatically excluded from compilation via the existing whitelist filtering in
flattenProjectForCompiler
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/editor/packages/editor-state/src/types.ts |
Added 'comment' to CodeBlockType union with documentation explaining its purpose |
packages/editor/packages/editor-state/src/pureHelpers/codeParsers/getBlockType.ts |
Extended detection logic with comment marker checks and mutual exclusion; moved from shaderUtils; added unit tests |
packages/editor/packages/editor-state/src/effects/menu/menus.ts |
Added "New Comment" menu option for creating comment blocks |
packages/editor/packages/editor-state/src/effects/compiler.ts |
Updated documentation to clarify comment blocks are excluded from compilation |
packages/editor/packages/editor-state/src/effects/compiler.test.ts |
Added comprehensive tests verifying comment blocks are excluded from compilation |
packages/editor/packages/editor-state/src/effects/codeBlocks/codeBlockCreator.ts |
Added comment block template generation with proper markers |
packages/editor/packages/editor-state/src/effects/codeBlocks/blockTypeUpdater.ts |
Updated import path for relocated getBlockType function |
packages/editor/packages/editor-state/src/pureHelpers/shaderEffects/derivePostProcessEffects.ts |
Updated import path for relocated getBlockType function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Introduces a dedicated
commentblock type for long-form documentation that persists in projects but is excluded from compilation. Users can now create standalone documentation blocks without using dummy modules or semicolon comments.Changes
'comment'toCodeBlockTypeunion in editor-state package only (compiler doesn't receive comment blocks)getBlockType()to recognizecomment/commentEndmarkers with mutual exclusion logic. Moved fromshaderUtilstocodeParsersdirectory for better organization.flattenProjectForCompiler()(filters by blockType)Example
Screenshot
Context menu showing new "New Comment" option:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.