m-novikov / tree-sitter-sql

SQL syntax highlighting for tree-sitter
MIT License
112 stars 33 forks source link

missing keywords in highlight.scm #4

Closed andykais closed 2 years ago

andykais commented 2 years ago

I created a pr to get this syntax into nvim-treesitter https://github.com/nvim-treesitter/nvim-treesitter/pull/2511. It appears that the highlight.scm file is incomplete, or outdated with the syntax. It is missing some keywords like AND/OR.

The syntax appears to be supported by the playground though https://m-novikov.github.io/tree-sitter-sql/. E.g.

SELECT a, b
FROM foo
WHERE a > b OR b = a;
[source_file](https://m-novikov.github.io/tree-sitter-sql/#) [0, 0] - [3, 0])
  [select_statement](https://m-novikov.github.io/tree-sitter-sql/#) [0, 0] - [2, 20])
    [select_clause](https://m-novikov.github.io/tree-sitter-sql/#) [0, 0] - [0, 11])
      [select_clause_body](https://m-novikov.github.io/tree-sitter-sql/#) [0, 7] - [0, 11])
        [identifier](https://m-novikov.github.io/tree-sitter-sql/#) [0, 7] - [0, 8])
        [identifier](https://m-novikov.github.io/tree-sitter-sql/#) [0, 10] - [0, 11])
    [from_clause](https://m-novikov.github.io/tree-sitter-sql/#) [1, 0] - [1, 8])
      [identifier](https://m-novikov.github.io/tree-sitter-sql/#) [1, 5] - [1, 8])
    [where_clause](https://m-novikov.github.io/tree-sitter-sql/#) [2, 0] - [2, 20])
      [comparison_operator](https://m-novikov.github.io/tree-sitter-sql/#) [2, 6] - [2, 20])
        [comparison_operator](https://m-novikov.github.io/tree-sitter-sql/#) [2, 6] - [2, 16])
          [identifier](https://m-novikov.github.io/tree-sitter-sql/#) [2, 6] - [2, 7])
          [boolean_expression](https://m-novikov.github.io/tree-sitter-sql/#) [2, 10] - [2, 16])
            [identifier](https://m-novikov.github.io/tree-sitter-sql/#) [2, 10] - [2, 11])
            [identifier](https://m-novikov.github.io/tree-sitter-sql/#) [2, 15] - [2, 16])
        [identifier](https://m-novikov.github.io/tree-sitter-sql/#) [2, 19] - [2, 20])
m-novikov commented 2 years ago

Hey, appreciate the feedback and am sorry for the late reply. NOT, AND, OR keywords are now in main. I didn't have enough time lately to gather test cases, so if you have any more create issues :)