Skip to content

Enhance comment handling support#209

Merged
llali merged 2 commits into
microsoft:mainfrom
rwestMSFT:rw-0527-fix-comments
Jun 4, 2026
Merged

Enhance comment handling support#209
llali merged 2 commits into
microsoft:mainfrom
rwestMSFT:rw-0527-fix-comments

Conversation

@rwestMSFT
Copy link
Copy Markdown
Contributor

Description

This pull request introduces significant improvements to how comments are preserved and emitted in the SQL Server script generator, especially around statement boundaries and formatting. The main focus is on ensuring that comments maintain their correct placement relative to SQL statements, particularly for trailing comments, single-line comments, and comments between statements and keywords like END. These changes improve the fidelity of script round-tripping and formatting.

Code Changes

Copy link
Copy Markdown
Member

@llali llali left a comment

Choose a reason for hiding this comment

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

the PR addresses more than one issue and it makes it too big and hard to review. I'm ok to approve this since the code won't affect the default behavior of parsers but please make smaller changes in each PR in upcoming PRs.

Comment thread SqlScriptDom/ScriptDom/SqlServer/ScriptGenerator/SqlScriptGeneratorVisitor.cs Outdated
@rwestMSFT
Copy link
Copy Markdown
Contributor Author

the PR addresses more than one issue and it makes it too big and hard to review. I'm ok to approve this since the code won't affect the default behavior of parsers but please make smaller changes in each PR in upcoming PRs.

I did try and break it up, but it would have created unexpected behaviour. Thanks for the feedback.

@llali llali merged commit bc884b9 into microsoft:main Jun 4, 2026
5 checks passed
@rwestMSFT rwestMSFT deleted the rw-0527-fix-comments branch June 4, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants