Feature/oops 4650/modify formatter logic - #3
Conversation
Working on comments and where line breaks occur after single line comments
ajhall
left a comment
There was a problem hiding this comment.
Can you add a summary to the PR description of what's included in these changes?
| Instance.Add("RIGHT OUTER JOIN", "RIGHT JOIN"); | ||
| Instance.Add("FULL OUTER JOIN", "FULL JOIN"); | ||
| Instance.Add("INNER JOIN", "JOIN"); | ||
| //Instance.Add("INNER JOIN", "JOIN"); |
There was a problem hiding this comment.
Disabling this line stops the formatter from converting JOIN to INNER JOIN, right?
If that's how this works most of the entries in this file look ok, but does that mean it also converts VARCHAR to CHAR VARYING and INT to INTEGER?
There was a problem hiding this comment.
I reverted this change as I found that these mappings are only utilized when the KeywordStandardization option of the formatter is set to true
…dStandardization option is set to true
| switch (contentElement.Name) | ||
| { | ||
| case SqlStructureConstants.ENAME_EXPRESSION_PARENS: | ||
| break; | ||
| } |
There was a problem hiding this comment.
Does this section do anything?
The outer switch statement is on contentElement.Parent.Name, and this inner one is on contentElement.Name.
The new case for SqlStructureConstants.ENAME_FUNCTION_PARENS catches something that would have otherwise fallen through to the default case, but the inner switch statement doesn't seem like it does anything.
There was a problem hiding this comment.
I remember that. Probably an errant test artifact that I had breakpoints on..... Debugging this code is a bear
There was a problem hiding this comment.
Yeah, I looked through this code for the first time as part of this PR, and... wow, what a huge switch statement. Thanks for working on this 😄
There was a problem hiding this comment.
I removed the switch case to nowhere and added a comment on why the empty case is present
These updates focus mostly on indentation/line breaks when single line comments are present either "in line" or as a line before a block of code.