-
Notifications
You must be signed in to change notification settings - Fork 10
indentation stripping #112
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
|
Disclaimer: I don't know rust -- please review carefully |
|
@NullVoxPopuli I've opened a new pull request, #113, to work on those changes. Once the pull request is ready, I'll request review from you. |
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 implements indentation stripping for <template> tags in .gjs/.gts files as specified in RFC #1121. The feature automatically removes leading/trailing whitespace and common indentation from embedded templates, allowing developers to write naturally indented code that compiles to properly dedented templates.
Key changes:
- Added
strip_indent()function in Rust to calculate and remove common indentation - Modified template content processing to apply indentation stripping before compilation
- Added comprehensive test coverage for various indentation scenarios including opt-out behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/transform.rs |
Core implementation of strip_indent() function and integration into template content processing |
src/lib.rs |
Integration tests for basic indentation stripping scenarios |
test/node/process.test.js |
Comprehensive test suite covering edge cases and RFC compliance |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…ing/trailing newline stripping
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
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
…ittle ambiguous, oops)
RFC: emberjs/rfcs#1121
Criteria / Algo:
<template>and closing</template>in gjs/gts files should be stripped.<template>and before the line with</template>