-
Notifications
You must be signed in to change notification settings - Fork 409
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
Switch from flatKeywordList()
to flat arrays
#676
Merged
nene
merged 8 commits into
sql-formatter-org:master
from
karlhorky:switch-from-flatKeywordList-to-flat-arrays
Dec 1, 2023
Merged
Switch from flatKeywordList()
to flat arrays
#676
nene
merged 8 commits into
sql-formatter-org:master
from
karlhorky:switch-from-flatKeywordList-to-flat-arrays
Dec 1, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
karlhorky
commented
Nov 29, 2023
karlhorky
commented
Nov 29, 2023
karlhorky
commented
Nov 29, 2023
Thanks 👍 |
Glad to help, thanks for the review and merge! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of preparations for PR #673
Copied from my original comment:
I see there is no distinction in the keyword tokens between
all
anddataType
/datatype
/dataTypes
:sql-formatter/src/languages/postgresql/postgresql.keywords.ts
Lines 4 to 8 in 290f3b7
sql-formatter/src/languages/transactsql/transactsql.functions.ts
Lines 78 to 83 in 290f3b7
sql-formatter/src/languages/snowflake/snowflake.keywords.ts
Lines 102 to 106 in 290f3b7
sql-formatter/src/languages/transactsql/transactsql.functions.ts
Lines 303 to 309 in 290f3b7
This is because of the
flatKeywordList()
function, which effectively discards the key information:sql-formatter/src/utils.ts
Lines 18 to 20 in 290f3b7
Because of this, I would like to simplify the
src/languages/*/*.keywords.ts
files to export 1 flat array (with empty lines + comments as separators instead of object keys) and delete theflatKeywordList()
function - this will prevent unusual, inconsistent naming conventions and also clarify that the object keys do nothing.Reviewer notes
master
anddevelop
, so that PRs from community members can be tested on GitHub Actionsa. if there was a commented URL above the key, I removed the key and left the URL as the sole comment (eg. in
src/languages/db2i/db2i.functions.ts
)b. if there was no other comment (or if the commented URL was generic, for multiple sections), I left the key name as the comment (eg. in
src/languages/hive/hive.functions.ts
)