Commit graph

51 commits

Author SHA1 Message Date
Anton Daitche
5b110f3440 From sql/highlights.scm, remove @type capture
@type is too generic and captures many different things, e.g. function
calls and table references. It doesn't capture builtin types, which are
captured by @type.builtin.

The outcome is that function calls are highlighted as types. Same for
table names.

I guess one can make an argument that tables are composite types in SQL,
but it doesn't feel right to highlight them in the same way as e.g.
`DOUBLE`.

To fix this issue, just remove the @type capture rule.
2025-12-04 11:16:47 +01:00
Raafat Turki
8f87d28442
feat(sql): add folds (#7686) 2025-02-26 17:36:48 +01:00
Amaan Qureshi
d912ede290 fix(sql): remove unused rules 2024-10-16 08:35:54 +02:00
Phạm Huy Hoàng
722617e672 refactor(format): drop extra indentation for field 2024-03-21 15:51:26 +01:00
Omar Valdez
93a9632b63 feat(sql): highlight fields in column definition 2024-03-20 12:06:16 +01:00
Jaehwang Jung
dccf31f9b1 feat(highlights)!: @keyword.storage@keyword.modifier 2024-03-16 20:51:16 +08:00
Jaehwang Jung
998b230a77 feat(highlights)!: keyword @type.qualifier@keyword.modifier 2024-03-16 20:51:16 +08:00
Phạm Huy Hoàng
77e298e4de chore: format queries 2024-01-21 23:55:02 +09:00
Pham Huy Hoang
57a8acf0c4 chore: query formatting 2024-01-19 16:58:37 +01:00
Christian Clason
1ae9b0e455 feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.

Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.

Specifically:

* tree-sitter "standard capture names"
  (3f44b89685/highlight/src/lib.rs (L20-L72)):

  - `@parameter` -> `@variable.parameter`
  - `@field` -> `@variable.member`
  - `@namespace` -> `@module`
  - `@float` -> `@number.float`
  - `@symbol` -> `@string.special.symbol`
  - `@string.regex` -> `@string.regexp`
  - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
  - `@text.title` -> `@markup.heading`
  - `@text.literal` -> `@markup.raw`
  - `@text.reference` -> `@markup.link`
  - `@text.uri` -> `@markup.link.url` (in markup links)
  - `@string.special` -> `@markup.link.label` (non-url links)
  - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)

* Helix captures
  (https://docs.helix-editor.com/master/themes.html#syntax-highlighting):

  - `@method` -> `@function.method`
  - `@method.call` -> `@function.method.call`
  - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
  - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
  - `@text.uri` -> `@string.special.url` (outside markup)
  - `@preproc` -> `@keyword.directive`
  - `@define` -> `@keyword.directive`(`.define`?)
  - `@storageclass` -> `@keyword.storage`
  - `@conditional` -> `@keyword.conditional`
  - `@debug` -> `@keyword.debug`
  - `@exception` -> `@keyword.exception`
  - `@include` -> `@keyword.import`
  - `@repeat` -> `@keyword.repeat`

* cleanup

  - remove some redundant `@conceal` (but still allow it for conceal-only patterns)
  - remove obsolete `@error` (syntax linting is out of scope for this repo)
  - sort, cleanup capture list in `CONTRIBUTING.md`
2024-01-19 16:58:37 +01:00
Derek Stride
1920285ec1 fix(sql): update queries from upstream 2023-11-02 19:39:34 +01:00
Matthias Q
33958915fe
highlights(sql): add t-sql specific data types (#5311) 2023-08-25 09:23:38 +09:00
Pham Huy Hoang
78b54eb7f6 chore(injections)!: update injection syntax to 0.9
Since 0.9, @lang syntax is still available as fallback but will soon be deprecated.
Because of that, new syntax should be adopted once 0.9 becomes the
baseline requirements for nvim-treesitter

- update health check
- update doc
2023-08-12 17:34:15 +02:00
Matthias Queitsch
2f5b4a65dc feat(sql): add missing keywords 2023-08-07 22:19:57 +01:00
Matthias Queitsch
e8648569d8 feat(sql): add new keywords 2023-07-30 10:45:04 +02:00
Matthias Q
e75b795f00
feat(sql): update queries for newly added keywords 2023-07-18 02:39:36 -04:00
Derek Stride
1a915819d8
feat(sql): update highlights from upstream 2023-07-05 16:05:56 -04:00
Dian Fay
849645e893
feat(sql): json operator highlights 2023-06-29 19:25:34 -04:00
Matthias Q
ea637db974
highlights(sql): add filter keyword 2023-06-29 14:54:33 +09:00
Dian M Fay
b75f79bc5f fix(sql): compound_statement -> block
a little more reorganizing; we've copied the indents file into
tree-sitter-sql and it tests okay there.
2023-06-25 17:31:24 +02:00
Matthias Queitsch
f26596386f highlights(sql): remove keyword_group_concat after refactor 2023-06-23 20:04:47 +02:00
Matthias Queitsch
ae04153314 highlights(sql): fix order for invocation 2023-06-22 18:18:42 +02:00
Dian M Fay
40ac56c493 fix(sql): invocation 2023-06-22 08:39:42 +02:00
Dian M Fay
38372dcda4 fix(sql): field alias moved to term 2023-06-22 08:39:42 +02:00
Dian M Fay
cabbda88c9 fix(sql): table_alias -> alias 2023-06-22 08:39:42 +02:00
Dian M Fay
3db1a461b9 fix(sql): table_reference -> object_reference 2023-06-22 08:39:42 +02:00
Matthias Q
517a79c848
feat(sql): add new keywords for optimization statements and renames 2023-06-19 13:09:47 -04:00
Matthias Q
dae928b3bb
indents(sql): initial support (#4857)
* indents(sql): initial support

* indents(sql): fix queries and lua style
2023-05-25 05:53:14 +00:00
Matthias Queitsch
b8ddb83d60 highlights(sql): add keyword overwrite 2023-05-23 21:08:50 -04:00
Matthias Queitsch
27079f7060 highlights(sql): refactor count to generic invocation 2023-05-15 20:00:22 -04:00
Derek Stride
0ec48923e5
feat(sql): add more keywords 2023-05-08 17:40:33 -04:00
Matthias Queitsch
d546bcd1f1 highlights(sql): add full, any and some keywords 2023-03-31 06:13:45 -04:00
Trey Wood
5d85bdd883 update sql parser and highlights 2023-03-29 18:29:40 -04:00
Matthias Queitsch
97a354ff44 highlights(sql): add new keywords for views and defaults 2023-03-22 22:01:21 +01:00
Matthias Queitsch
fc1ca10bfb highlights(sql): add new keywords and datatypes 2023-03-08 17:32:22 -05:00
Matthias Queitsch
d4e48be88d highlights(sql): keywords as @storageclass 2023-03-04 06:14:31 -05:00
Matthias Queitsch
d382b41563 highlights(sql): added missing kwds, added @attribute and @type.qualifier kwds 2023-03-04 06:14:31 -05:00
Matthias Queitsch
e3a1ae4c4e highlights(sql): add missing keywords 2023-03-04 06:14:31 -05:00
Matthias Queitsch
c9d7f9c920 highlights(sql): update highlight queries
highlights(sql): add bool, attributes, conditionals

highlights(sql): add builtins

highlights(sql): add parameters

highlights(sql): add temp table attribute

update sql highlights; add floats

bump sql version

bump upstream sql version

highlights(sql): fix float regex

fix upstream changes; bump sql version
2023-02-20 22:47:45 -08:00
Derek Stride
9705316fff
sql: update parser and query (#3820)
Add better `term` nodes in the select expression
2022-11-18 14:20:39 +00:00
Matthias Queitsch
3aef8d60ae highlights(sql): remove grouped keyword 2022-09-14 08:22:21 +02:00
Matthias Queitsch
1c384edc57 highlights(sql): removed duplicate keywords, added new keyword, hashing
as function.calls
2022-09-14 08:22:21 +02:00
derekstride
612af3061d highlights(sql): missing keyword & marginalia 2022-09-08 21:13:17 +02:00
Matthias Queitsch
5b4fd6ba00 removed duplicated kw, start capturing subtree earlier 2022-09-08 17:44:21 +02:00
Matthias Queitsch
72eac1deeb change table_expression -> table_reference 2022-09-08 17:44:21 +02:00
Matthias Queitsch
6e0e03285a account for added and renamed keywords 2022-08-29 01:30:28 -07:00
derekstride
3832fde3ee SQL highlight queries rely on latest parser AST 2022-08-05 21:20:11 +02:00
lfenzo
c784720917 Split func/method definition from calls in several programming language queries 2022-08-03 12:05:30 -07:00
Robert Liebowitz
97a0322c63
Highlight sql comments (#3178) 2022-07-14 14:07:10 +00:00
derekstride
1b6debcf69 Update lockfile and highlight queries 2022-07-08 00:15:40 +02:00