nvim-treesitter/runtime/queries/sql/highlights.scm

428 lines
7.3 KiB
Scheme
Raw Normal View History

2023-11-02 14:26:21 -04:00
(invocation
(object_reference
name: (identifier) @function.call))
2023-03-02 23:18:10 +01:00
[
(keyword_gist)
(keyword_btree)
(keyword_hash)
(keyword_spgist)
(keyword_gin)
(keyword_brin)
(keyword_array)
] @function.call
(object_reference
2021-03-14 22:38:54 -02:30
name: (identifier) @type)
(relation
2023-06-20 19:53:35 -04:00
alias: (identifier) @variable)
2021-03-14 22:38:54 -02:30
(field
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" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/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`
2023-12-24 10:00:20 +01:00
name: (identifier) @variable.member)
2021-03-14 22:38:54 -02:30
(column_definition
name: (identifier) @variable.member)
(term
alias: (identifier) @variable)
2024-01-21 22:05:44 +09:00
(term
value: (cast
name: (keyword_cast) @function.call
parameter: (literal)?))
2022-07-04 15:03:34 -04:00
(literal) @string
2024-01-06 15:05:50 +09:00
2023-03-02 23:18:10 +01:00
(comment) @comment @spell
2024-01-06 15:05:50 +09:00
(marginalia) @comment
2022-07-04 15:03:34 -04:00
2021-03-14 22:38:54 -02:30
((literal) @number
2024-01-06 15:05:50 +09:00
(#lua-match? @number "^%d+$"))
2021-03-14 22:38:54 -02:30
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" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/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`
2023-12-24 10:00:20 +01:00
((literal) @number.float
(#lua-match? @number.float "^[-]?%d*%.%d*$"))
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" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/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`
2023-12-24 10:00:20 +01:00
(parameter) @variable.parameter
[
2024-01-06 15:05:50 +09:00
(keyword_true)
(keyword_false)
] @boolean
[
2024-01-06 15:05:50 +09:00
(keyword_asc)
(keyword_desc)
(keyword_terminated)
(keyword_escaped)
(keyword_unsigned)
(keyword_nulls)
(keyword_last)
(keyword_delimited)
(keyword_replication)
(keyword_auto_increment)
(keyword_default)
(keyword_collate)
(keyword_concurrently)
(keyword_engine)
(keyword_always)
(keyword_generated)
(keyword_preceding)
(keyword_following)
(keyword_first)
(keyword_current_timestamp)
(keyword_immutable)
(keyword_atomic)
(keyword_parallel)
(keyword_leakproof)
(keyword_safe)
(keyword_cost)
(keyword_strict)
] @attribute
[
2024-01-06 15:05:50 +09:00
(keyword_materialized)
(keyword_recursive)
(keyword_temp)
(keyword_temporary)
(keyword_unlogged)
(keyword_external)
(keyword_parquet)
(keyword_csv)
(keyword_rcfile)
(keyword_textfile)
(keyword_orc)
(keyword_avro)
(keyword_jsonfile)
(keyword_sequencefile)
(keyword_volatile)
] @keyword.modifier
[
2024-01-06 15:05:50 +09:00
(keyword_case)
(keyword_when)
(keyword_then)
(keyword_else)
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" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/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`
2023-12-24 10:00:20 +01:00
] @keyword.conditional
2021-03-14 22:38:54 -02:30
[
(keyword_select)
(keyword_from)
(keyword_where)
(keyword_index)
(keyword_join)
(keyword_primary)
(keyword_delete)
(keyword_create)
(keyword_insert)
(keyword_merge)
2021-03-14 22:38:54 -02:30
(keyword_distinct)
(keyword_replace)
(keyword_update)
(keyword_into)
(keyword_overwrite)
2023-11-02 14:26:21 -04:00
(keyword_matched)
2021-03-14 22:38:54 -02:30
(keyword_values)
2023-11-02 14:26:21 -04:00
(keyword_value)
(keyword_attribute)
2021-03-14 22:38:54 -02:30
(keyword_set)
(keyword_left)
(keyword_right)
(keyword_outer)
(keyword_inner)
(keyword_full)
2022-08-29 05:03:23 +02:00
(keyword_order)
2023-03-02 23:18:10 +01:00
(keyword_partition)
2022-08-29 05:03:23 +02:00
(keyword_group)
(keyword_with)
2023-11-02 14:26:21 -04:00
(keyword_without)
(keyword_as)
2021-03-14 22:38:54 -02:30
(keyword_having)
(keyword_limit)
(keyword_offset)
(keyword_table)
(keyword_tables)
2021-03-14 22:38:54 -02:30
(keyword_key)
2023-05-08 17:40:33 -04:00
(keyword_references)
(keyword_foreign)
2021-03-14 22:38:54 -02:30
(keyword_constraint)
(keyword_force)
(keyword_use)
(keyword_for)
(keyword_if)
(keyword_exists)
2022-07-04 15:03:34 -04:00
(keyword_column)
(keyword_columns)
2022-07-04 15:03:34 -04:00
(keyword_cross)
(keyword_lateral)
2023-11-02 14:26:21 -04:00
(keyword_natural)
2022-07-04 15:03:34 -04:00
(keyword_alter)
(keyword_drop)
(keyword_add)
(keyword_view)
(keyword_end)
(keyword_is)
(keyword_using)
2022-08-29 05:03:23 +02:00
(keyword_between)
(keyword_window)
2022-07-04 15:03:34 -04:00
(keyword_no)
(keyword_data)
(keyword_type)
(keyword_rename)
(keyword_to)
(keyword_schema)
(keyword_owner)
2023-11-02 14:26:21 -04:00
(keyword_authorization)
2022-07-04 15:03:34 -04:00
(keyword_all)
(keyword_any)
(keyword_some)
2022-07-04 15:03:34 -04:00
(keyword_returning)
(keyword_begin)
(keyword_commit)
(keyword_rollback)
(keyword_transaction)
(keyword_only)
(keyword_like)
(keyword_similar)
(keyword_over)
2023-03-02 23:18:10 +01:00
(keyword_change)
(keyword_modify)
(keyword_after)
2023-07-30 08:31:18 +02:00
(keyword_before)
2023-03-02 23:18:10 +01:00
(keyword_range)
(keyword_rows)
(keyword_groups)
(keyword_exclude)
(keyword_current)
(keyword_ties)
(keyword_others)
(keyword_zerofill)
(keyword_format)
(keyword_fields)
(keyword_row)
(keyword_sort)
(keyword_compute)
(keyword_comment)
(keyword_location)
(keyword_cached)
(keyword_uncached)
2023-03-02 23:18:10 +01:00
(keyword_lines)
(keyword_stored)
2023-11-02 14:26:21 -04:00
(keyword_virtual)
(keyword_partitioned)
(keyword_analyze)
2023-11-02 14:26:21 -04:00
(keyword_explain)
(keyword_verbose)
(keyword_truncate)
(keyword_rewrite)
(keyword_optimize)
(keyword_vacuum)
(keyword_cache)
(keyword_language)
(keyword_called)
(keyword_conflict)
(keyword_declare)
(keyword_filter)
(keyword_function)
(keyword_input)
(keyword_name)
(keyword_oid)
2023-11-02 14:26:21 -04:00
(keyword_oids)
(keyword_precision)
(keyword_regclass)
(keyword_regnamespace)
(keyword_regproc)
(keyword_regtype)
(keyword_restricted)
(keyword_return)
(keyword_returns)
(keyword_separator)
(keyword_setof)
(keyword_stable)
(keyword_support)
(keyword_tblproperties)
(keyword_trigger)
(keyword_unsafe)
2023-11-02 14:26:21 -04:00
(keyword_admin)
(keyword_connection)
(keyword_cycle)
(keyword_database)
(keyword_encrypted)
(keyword_increment)
(keyword_logged)
(keyword_none)
(keyword_owned)
(keyword_password)
(keyword_reset)
(keyword_role)
(keyword_sequence)
2023-08-07 23:01:03 +02:00
(keyword_start)
(keyword_restart)
2023-11-02 14:26:21 -04:00
(keyword_tablespace)
(keyword_until)
(keyword_user)
(keyword_valid)
(keyword_action)
(keyword_definer)
(keyword_invoker)
(keyword_security)
(keyword_extension)
(keyword_version)
(keyword_out)
(keyword_inout)
(keyword_variadic)
(keyword_session)
(keyword_isolation)
(keyword_level)
(keyword_serializable)
(keyword_repeatable)
(keyword_read)
(keyword_write)
(keyword_committed)
(keyword_uncommitted)
(keyword_deferrable)
(keyword_names)
(keyword_zone)
(keyword_immediate)
(keyword_deferred)
(keyword_constraints)
(keyword_snapshot)
(keyword_characteristics)
(keyword_off)
(keyword_follows)
(keyword_precedes)
(keyword_each)
(keyword_instead)
(keyword_of)
(keyword_initially)
(keyword_old)
(keyword_new)
(keyword_referencing)
(keyword_statement)
(keyword_execute)
(keyword_procedure)
] @keyword
[
2024-01-06 15:05:50 +09:00
(keyword_restrict)
(keyword_unbounded)
(keyword_unique)
(keyword_cascade)
(keyword_delayed)
(keyword_high_priority)
(keyword_low_priority)
(keyword_ignore)
(keyword_nothing)
(keyword_check)
(keyword_option)
(keyword_local)
(keyword_cascaded)
(keyword_wait)
(keyword_nowait)
(keyword_metadata)
(keyword_incremental)
(keyword_bin_pack)
(keyword_noscan)
(keyword_stats)
(keyword_statistics)
(keyword_maxvalue)
(keyword_minvalue)
] @keyword.modifier
2023-03-02 23:18:10 +01:00
[
(keyword_int)
2022-07-04 15:03:34 -04:00
(keyword_null)
(keyword_boolean)
(keyword_binary)
(keyword_varbinary)
(keyword_image)
2023-03-02 23:18:10 +01:00
(keyword_bit)
2023-05-08 17:40:33 -04:00
(keyword_inet)
(keyword_character)
2022-07-04 15:03:34 -04:00
(keyword_smallserial)
(keyword_serial)
(keyword_bigserial)
(keyword_smallint)
(keyword_mediumint)
2022-07-04 15:03:34 -04:00
(keyword_bigint)
(keyword_tinyint)
2022-07-04 15:03:34 -04:00
(keyword_decimal)
2023-03-02 23:18:10 +01:00
(keyword_float)
(keyword_double)
2022-07-04 15:03:34 -04:00
(keyword_numeric)
(keyword_real)
(double)
2022-07-04 15:03:34 -04:00
(keyword_money)
(keyword_smallmoney)
2022-07-04 15:03:34 -04:00
(keyword_char)
(keyword_nchar)
2022-07-04 15:03:34 -04:00
(keyword_varchar)
(keyword_nvarchar)
(keyword_varying)
2022-07-04 15:03:34 -04:00
(keyword_text)
(keyword_string)
2022-07-04 15:03:34 -04:00
(keyword_uuid)
(keyword_json)
(keyword_jsonb)
(keyword_xml)
(keyword_bytea)
2023-03-29 13:26:25 -06:00
(keyword_enum)
2022-07-04 15:03:34 -04:00
(keyword_date)
(keyword_datetime)
(keyword_time)
(keyword_datetime2)
(keyword_datetimeoffset)
(keyword_smalldatetime)
2022-07-04 15:03:34 -04:00
(keyword_timestamp)
(keyword_timestamptz)
(keyword_geometry)
(keyword_geography)
(keyword_box2d)
(keyword_box3d)
(keyword_interval)
] @type.builtin
2021-03-14 22:38:54 -02:30
[
(keyword_in)
(keyword_and)
(keyword_or)
(keyword_not)
2023-03-02 23:18:10 +01:00
(keyword_by)
(keyword_on)
(keyword_do)
2023-11-02 14:26:21 -04:00
(keyword_union)
(keyword_except)
(keyword_intersect)
2021-03-14 22:38:54 -02:30
] @keyword.operator
[
"+"
"-"
"*"
"/"
"%"
"^"
":="
2021-03-14 22:38:54 -02:30
"="
"<"
"<="
"!="
">="
">"
2023-03-02 23:18:10 +01:00
"<>"
2023-11-02 14:26:21 -04:00
(op_other)
(op_unary_other)
2021-03-14 22:38:54 -02:30
] @operator
[
"("
")"
] @punctuation.bracket
[
";"
","
"."
] @punctuation.delimiter