-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/oops 4650/modify formatter logic #3
base: master
Are you sure you want to change the base?
Conversation
Working on comments and where line breaks occur after single line comments
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.
Can you add a summary to the PR description of what's included in these changes?
@@ -34,7 +34,7 @@ static ObfuscatingKeywordMapping() | |||
Instance.Add("LEFT OUTER JOIN", "LEFT JOIN"); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the switch case to nowhere and added a comment on why the empty case is present
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.
Looks good!
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.