Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scriptcoded/sql-highlight
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.0.0
Choose a base ref
...
head repository: scriptcoded/sql-highlight
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.0.0
Choose a head ref
  • 14 commits
  • 19 files changed
  • 5 contributors

Commits on Jul 2, 2024

  1. 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.
    scriptsbot authored and scriptcoded committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    416a4b4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5db42e3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ecd93d3 View commit details
    Browse the repository at this point in the history
  4. 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
    wkeese authored and scriptcoded committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    25677d4 View commit details
    Browse the repository at this point in the history
  5. fix: improve number detection

    Fixes #149
    wkeese authored and scriptcoded committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    02d459a View commit details
    Browse the repository at this point in the history
  6. 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
    wkeese authored and scriptcoded committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    183a4fb View commit details
    Browse the repository at this point in the history
  7. fix: typo in unknown segments

    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.
    wkeese authored and scriptcoded committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    70af287 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8422e26 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    90fcfcc View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9bbb858 View commit details
    Browse the repository at this point in the history
  11. 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]>
    dependabot[bot] committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    d350978 View commit details
    Browse the repository at this point in the history
  12. 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.
    scriptsbot committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    9e7a8ba View commit details
    Browse the repository at this point in the history
  13. feat: release 5.1.0

    scriptcoded committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    3a58def View commit details
    Browse the repository at this point in the history
  14. 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.
    scriptsbot committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    afbc0fe View commit details
    Browse the repository at this point in the history
Loading