Commit graph

65 commits

Author SHA1 Message Date
Phạm Huy Hoàng
722617e672 refactor(format): drop extra indentation for field 2024-03-21 15:51:26 +01:00
再生花
31641d72a4
feat(format-scripts): linewrap predicates
"format-ignore".kick()
2024-02-23 10:42:01 +02:00
Pham Huy Hoang
57a8acf0c4 chore: query formatting 2024-01-19 16:58:37 +01:00
Pham Huy Hoang
edee83272e refactor: manual pre-cleanup
Moving comments, adding `format-ignore` to lines that will be better
with it
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
Riley Bruins
92572c0dfd feat: more @string.regex highlights 2023-12-23 22:26:02 +01:00
Pham Huy Hoang
107e61afb7 refactor: Remove all (ERROR) @error captures
As discussed in PR#5421, capturing `@error` is inconsistent, requiring
deep nesting (or priority) in order to correctly have red backgrounds to
it.

Some queries has this capture, some don't. For consistency purposes,
removing all of them is more preferable.

For re-enabling error, either add `(ERROR) @error` or `(ERROR _ @error)`
to your custom queries.
2023-10-25 18:18:50 +02:00
Riley Bruins
74ea25f95d
feat(lua): highlight variadic expressions as builtin parameters (#5567) 2023-10-24 11:19:12 +09:00
Munif Tanjim
80b4fa7970 fix(lua): highlights for attribute 2023-09-07 03:36:55 -04: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
ShellCode33
d9e75a1736 queries/*/highlights.scm : remove @spell for strings 2023-08-07 16:39:40 +01:00
Munif Tanjim
a954f789aa
feat(lua): update highlights query for functions (#4919) 2023-06-08 00:12:54 +02:00
Amaan Qureshi
b8a0791eb4 refactor(lua): move _VERSION to @constant.builtin, builtin types to @namespace.builtin 2023-04-28 10:29:42 -04:00
Amaan Qureshi
581fc14cea queries(lua): add more keywords related to variable/function builtins, debug, and coroutines 2023-03-20 03:13:41 -04:00
Amaan Qureshi
2170a36416 fix(lua): properly highlight labels 2023-03-20 03:13:00 -04:00
Amaan Qureshi
11b2d430e6 feat(lua): add more builtin variables per lua_ls 2023-03-11 15:16:46 -05:00
Amaan Qureshi
5a87bc98da feat: add @comment.documentation where applicable 2023-03-05 17:15:32 -05:00
Jaehwang Jung
a0dc6c8635 highlights(lua): use @method.call 2022-12-15 12:42:51 +01:00
Christian Clason
e7bdcee167 lua: update queries 2022-11-01 13:41:33 +01:00
ObserverOfTime
9b43ab819c highlights: use @preproc where appropriate 2022-10-15 08:49:01 -07:00
Lewis Russell
37398c7d68 feat(spell): support more languages 2022-09-26 13:47:12 +01:00
Lewis Russell
c836f946a9 highlights(lua): add spell 2022-09-12 11:02:35 +01:00
lfenzo
c784720917 Split func/method definition from calls in several programming language queries 2022-08-03 12:05:30 -07:00
Janfel
881b932893 highlights(lua): use #eq? instead of #match?
Co-authored-by: Santos Gallegos <stsewd@protonmail.com>
2022-06-24 20:27:58 +02:00
Janfel
8d43730388 highlights(lua): highlight only self as self
Before, all identifiers containing the substring "self" were highlighted as the builtin `self`. Now, only the identifier `self` is highlighted as `self`.
2022-06-24 20:27:58 +02:00
Christian Clason
6ece0ca4e6 fix(lua): restore precedence for @variable.builtin and @constant.builtin 2022-03-12 23:00:08 +01:00
Stephan Seitz
fa8172ffb4 highlights(lua): don't highlight arguments as parameters 2022-01-30 09:55:48 +01:00
Christian Clason
c80715f883
feat(lua)!: switch from our fork to MunifTanjim's (#2272)
also take queries from https://github.com/MunifTanjim/nvim-treesitter-lua/tree/main/queries/lua

BREAKING CHANGE: queries are not compatible; modules will have to update
2022-01-18 22:15:26 +01:00
numToStr
63630ec082 highlights(lua): next as builtin function 2021-12-13 20:22:05 +01:00
Lewis Russell
011ac894ec Prefer lua-match over match
as string.find is much quicker than vim.regex:match*
2021-11-23 10:02:06 +01:00
Sergio Alejandro Vargas
a5f62c5764 highlights(lua): Add Lua 5.1 built-in functions 2021-09-01 07:07:16 +02:00
Sergio Alejandro Vargas
a1be6c9d4f highlights(lua): Add semicolons 2021-08-17 10:18:33 +02:00
Santos Gallegos
460a26ef32
Lua: highlight uppercase variables as constants (#1690) 2021-08-14 13:33:55 -05:00
Sergio Alejandro Vargas
50a77bbc22 highlights(lua): Organize function_call queries 2021-08-02 15:52:56 +02:00
Sergio Alejandro Vargas
0ed69e50a8 highlights(lua): Fix method calls
The usual `function_call` query would highlight the objects at the
beginning of a method call. The `method` query has to account for this,
and highlight the identifier as a variable again.
2021-08-02 15:52:56 +02:00
Santos Gallegos
989fc7aa6c Lua: highlight function definitions
In lua

```lua
function foo() end
```

is syntax sugar for

```lua
foo = function() end
```
2021-07-07 23:17:43 +02:00
antonk52
90f15d9bf7 feat(keywords) merge return and yield into keyword.return group 2021-07-04 21:49:17 +02:00
antonk52
bd9095e969 feat(keywords) add keyword.return & keyword.yield 2021-07-04 21:49:17 +02:00
Folke Lemaitre
d1f6a2a3d8 feat: added self as builtin keyword for Lua 2021-06-17 15:53:20 +02:00
Thomas Vigouroux
f0ab5edab9 fix(lua): correctly highlight field names 2021-04-22 17:51:43 +02:00
Santos Gallegos
98127bded6 Lua: highlight fields 2021-02-10 22:15:17 +01:00
Thomas Vigouroux
b8a7f0ea38 fix(lua): correctly highlight do_statement 2021-01-27 10:21:37 +01:00
Thomas Vigouroux
d5a8ff94cd lua: update to pull shebang fix 2020-11-25 21:47:38 +01:00
Thomas Vigouroux
809b95ddb1 lua: fix "then" highlighting 2020-11-23 23:17:28 +01:00
Chinmay Dalal
6d352a0efc
Add lua params (#605)
* Add lua params

* Fix

* Remove redundant outer
2020-10-21 06:46:05 +02:00
Stephan Seitz
7e3c4f8089 Add @keyword.operator for operators that are English words and add @exception for Java/JS 2020-09-19 07:30:49 +02:00
Stephan Seitz
bcf421b4e7 Fix #307: Use and document TSVariable/TSVariableBuiltin in all languages 2020-09-14 18:27:20 +02:00
kyazdani42
3a3a1bb252 use keyword.function instead of function 2020-09-08 19:23:04 +02:00
kyazdani42
b10a09ebc3 fix function/end keywords not applied for every scope 2020-09-08 19:23:04 +02:00
kyazdani42
b69b43b712 fix: contional > conditional in lua hl.scm 2020-09-06 18:32:14 +02:00