-
-
Notifications
You must be signed in to change notification settings - Fork 14
Comparing changes
Open a pull request
base repository: scriptcoded/sql-highlight
base: v5.0.0
head repository: scriptcoded/sql-highlight
compare: v6.0.0
- 14 commits
- 19 files changed
- 5 contributors
Commits on Jul 2, 2024
-
chore(release): 5.0.0 [skip ci]
# [5.0.0](v4.4.2...v5.0.0) (2024-06-23) * chore!: add support for Node 22 ([628360f](628360f)) ### BREAKING CHANGES * drop support for Node 14.
Configuration menu - View commit details
-
Copy full SHA for 416a4b4 - Browse repository at this point
Copy the full SHA 416a4b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5db42e3 - Browse repository at this point
Copy the full SHA 5db42e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ecd93d3 - Browse repository at this point
Copy the full SHA ecd93d3View commit details -
feat: add way to style identifiers
Replace "default" segment with "whitespace" and "identifier" segments, with fallback to "unknown" segment. Also, classify backticked identifiers like `foo` as "identifier" rather than "string". This allows for identifiers to be styled independently from strings and whitespace. It also simplifies getSegments() from 30 lines down to 5, by removing the special-case code for the "default" segment. BREAKING CHANGE: The `default` segment has been split into `identifier` and `whitespace` segments. There's also a new `unknown` segment that will only show up for malformed SQL such as an unclosed string. However, the highlight() function works largely the same as before, both normal mode and HTML mode, except for the bug fix to stop classifying identifiers as strings. In other words, SQL like select * from EMP where NAME="John Smith" will get highlighted the same as before, i.e. no syntax highlighting for EMP or NAME. Fixes #147
Configuration menu - View commit details
-
Copy full SHA for 25677d4 - Browse repository at this point
Copy the full SHA 25677d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 02d459a - Browse repository at this point
Copy the full SHA 02d459aView commit details -
fix: improve operator detection
This fixes the "special" segments to include some missing operators from https://www.w3schools.com/sql/sql_operators.asp and other sites. I took the conservative approach of listing all the operators, as opposed to the general regexp /(?<special>[^\w\s"'`]+)/, because the conservative approach works better in certain cases such as "x>-5". The downside is that you need to list all the operators, so it's a bit fragile, especially since the exact operators vary by SQL version (MySQL, TransactSQL, Postgres, etc.). I kept all the symbols previously specified as "special" even though some of them aren't operators, specifically: , ; : . Fixes #150
Configuration menu - View commit details
-
Copy full SHA for 183a4fb - Browse repository at this point
Copy the full SHA 183a4fbView commit details -
Rearrange regexps so "special" regexp catches everything not caught by other regexps. Eliminates the "unknown" segment I added in #148. In practice, the only time we would hit the "unknown" segment is for a few weird characters that weren't already caught by the "special" segment, for example, the ? and unclosed ` in "a `?> b". I figured that in those rare cases, we might as well just call those characters "special". Fixes #178, refs #148.
Configuration menu - View commit details
-
Copy full SHA for 70af287 - Browse repository at this point
Copy the full SHA 70af287View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8422e26 - Browse repository at this point
Copy the full SHA 8422e26View commit details -
Configuration menu - View commit details
-
Copy full SHA for 90fcfcc - Browse repository at this point
Copy the full SHA 90fcfccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9bbb858 - Browse repository at this point
Copy the full SHA 9bbb858View commit details -
chore(deps-dev): bump braces from 3.0.2 to 3.0.3
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](micromatch/braces@3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d350978 - Browse repository at this point
Copy the full SHA d350978View commit details -
chore(release): 5.0.0 [skip ci]
# [5.0.0](v4.4.2...v5.0.0) (2024-07-02) * chore!: add support for Node 22 ([9478bf1](9478bf1)) ### Bug Fixes * improve number detection ([02d459a](02d459a)), closes [#149](#149) * improve operator detection ([183a4fb](183a4fb)), closes [#150](#150) * typo in unknown segments ([70af287](70af287)), closes [#148](#148) [#178](#178) [#148](#148) ### Features * add way to style identifiers ([25677d4](25677d4)), closes [#147](#147) ### BREAKING CHANGES * The `default` segment has been split into `identifier` and `whitespace` segments. There's also a new `unknown` segment that will only show up for malformed SQL such as an unclosed string. However, the highlight() function works largely the same as before, both normal mode and HTML mode, except for the bug fix to stop classifying identifiers as strings. In other words, SQL like select * from EMP where NAME="John Smith" will get highlighted the same as before, i.e. no syntax highlighting for EMP or NAME. * drop support for Node 14.
Configuration menu - View commit details
-
Copy full SHA for 9e7a8ba - Browse repository at this point
Copy the full SHA 9e7a8baView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a58def - Browse repository at this point
Copy the full SHA 3a58defView commit details -
chore(release): 6.0.0 [skip ci]
# [6.0.0](v5.0.0...v6.0.0) (2024-07-02) ### Bug Fixes * improve number detection ([02d459a](02d459a)), closes [#149](#149) * improve operator detection ([183a4fb](183a4fb)), closes [#150](#150) * typo in unknown segments ([70af287](70af287)), closes [#148](#148) [#178](#178) [#148](#148) ### Features * add way to style identifiers ([25677d4](25677d4)), closes [#147](#147) * release 5.1.0 ([3a58def](3a58def)) ### BREAKING CHANGES * The `default` segment has been split into `identifier` and `whitespace` segments. There's also a new `unknown` segment that will only show up for malformed SQL such as an unclosed string. However, the highlight() function works largely the same as before, both normal mode and HTML mode, except for the bug fix to stop classifying identifiers as strings. In other words, SQL like select * from EMP where NAME="John Smith" will get highlighted the same as before, i.e. no syntax highlighting for EMP or NAME.
Configuration menu - View commit details
-
Copy full SHA for afbc0fe - Browse repository at this point
Copy the full SHA afbc0feView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v5.0.0...v6.0.0