Skip to content

update sql formatter to preserve comments#18

Merged
alex-bochkov merged 3 commits intoAxial-SQL:mainfrom
strikeman342:preserve-comments
Oct 18, 2025
Merged

update sql formatter to preserve comments#18
alex-bochkov merged 3 commits intoAxial-SQL:mainfrom
strikeman342:preserve-comments

Conversation

@strikeman342
Copy link
Copy Markdown
Contributor

updated the sql formatter to preserve comments - this involves adding a "CommentInterleaver" as parsing and regeneration via SqlScriptGenerator will discard all comments. Note: updated original Sql160ScriptGenerator reference to Sql170ScriptGenerator to be in line with the original TSql170Parser.

this fixes issue #13

strikeman342 and others added 2 commits September 2, 2025 12:34
updated the sql formatter to preserve comments - this involves adding a "CommentInterleaver" as parsing and regeneration via SqlScriptGenerator will discard all comments.
Note: updated original Sql160ScriptGenerator reference to Sql170ScriptGenerator to be in line with the original TSql170Parser.
@alex-bochkov
Copy link
Copy Markdown
Contributor

@strikeman342 - Andy, thanks for this - great work!
I'll run some tests and plan to merge it a bit later.

@strikeman342
Copy link
Copy Markdown
Contributor Author

strikeman342 commented Sep 3, 2025

you're welcome, I hope everything works as expected; there might still be some VERY SPECIFIC cases where the comments aren't formatted properly - as you can see I've had to do some gnarly things here and there to try to keep the formatting as good as I could :-)

@alex-bochkov alex-bochkov merged commit 75ab36f into Axial-SQL:main Oct 18, 2025
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