Skip to content

refactor(compiler): Collect in-element comments#69218

Open
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:collect-comments
Open

refactor(compiler): Collect in-element comments#69218
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:collect-comments

Conversation

@JeanMeche

Copy link
Copy Markdown
Member

#67179 forgot to implement that part.

@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Jun 7, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jun 7, 2026
@JeanMeche JeanMeche force-pushed the collect-comments branch 5 times, most recently from b523b73 to 6ed063d Compare June 7, 2026 21:53
@JeanMeche JeanMeche requested a review from JoostK June 7, 2026 21:54
@JeanMeche JeanMeche marked this pull request as ready for review June 7, 2026 22:44
Comment thread packages/compiler/src/ml_parser/lexer.ts Outdated
Comment thread packages/compiler/src/ml_parser/lexer.ts Outdated

@JoostK JoostK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments also apply to the multiline parsing, of course

Comment thread packages/compiler/src/ml_parser/lexer.ts Outdated
Comment thread packages/compiler/src/ml_parser/lexer.ts Outdated
Comment thread packages/compiler/src/ml_parser/lexer.ts Outdated
Comment on lines +815 to +825
const commentStart = 0;
const commentEnd = content.length;
const spanStart = contentStart.clone();
for (let i = 0; i < commentStart; i++) {
spanStart.advance();
}

const spanEnd = contentStart.clone();
for (let i = 0; i < commentEnd; i++) {
spanEnd.advance();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is really necessary. spanStart is guaranteed to be contentStart as commentStart is always 0, and commentEnd is probably better achieved by subtracting the */ span (for multiline, singleline remains the end itself) instead of walking over all comment text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compiler Issues related to `ngc`, Angular's template compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants