Commit graph

35 commits

Author SHA1 Message Date
Riley Bruins
63c532fde5 feat(swift): fold queries 2024-09-19 08:43:58 +02:00
Riley Bruins
12e339e370 feat(swift): add many missing highlights 2024-09-19 08:43:44 +02:00
Riley Bruins
9d68e876cc feat: more comment injections 2024-06-15 10:40:34 +02:00
Colin Bruins
eb59a3df50
feat(swift): highlight shebang lines 2024-06-10 13:05:10 -04:00
Christian Clason
a80fe081b4 feat(predicates)!: rename has-type to kind-eq to align with Helix
No point in having a different name for the same predicate.
2024-06-02 12:07:58 +02:00
Riley Bruins
f58cae6c22 feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
Wojciech Kulik
aa31b8d4cc fix(swift): highlights 2024-03-25 18:49:52 +01:00
Jaehwang Jung
998b230a77 feat(highlights)!: keyword @type.qualifier@keyword.modifier 2024-03-16 20:51:16 +08:00
再生花
e73c775aa9 feat(swift): add init/deinit indents
Signed-off-by: Phạm Huy Hoàng <hoangtun0810@gmail.com>
2024-03-13 11:09:42 +08:00
Phạm Huy Hoàng
63ca90eaa3 feat(swift): add will/didSet indent
Fixes CI error in PR.6237
2024-03-04 00:05:45 +09:00
Phạm Huy Hoàng
77e298e4de chore: format queries 2024-01-21 23:55:02 +09:00
Phạm Huy Hoàng
d198a75e2c
Fixup format (#5934)
* fix(format): newline between top-level field defs

* fixup: newline between node and comment

* fixup: optimize pattern
2024-01-20 18:47:56 +09:00
ObserverOfTime
fa38f4e6f9 fix(highlights): improve member/property distinction 2024-01-19 16:58:37 +01: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
Christian Clason
5b90ea2aba feat(locals)!: switch to upstream captures 2024-01-19 16:58:37 +01:00
Alex Pinkus
96a5024198
feat(swift): update parser and queries
Co-authored-by: Alex Pinkus <pinkus@amazon.com>
2023-09-10 19:38:36 +02:00
Gustavo Ordaz
add1864bbf feat(swift): improve highlights 2023-08-18 04:48:40 -04:00
Pham Huy Hoang
1aea2eee29
refactor: add notes for swift
Also add enum_class_body
2023-05-19 00:57:18 +09:00
Pham Huy Hoang
864b4171de
feat: add swift indents (#4756) 2023-05-08 14:53:31 +09:00
Amaan Qureshi
5a87bc98da feat: add @comment.documentation where applicable 2023-03-05 17:15:32 -05:00
Amaan Qureshi
33ba346e60 feat!: add @keyword.coroutine capture 2023-03-03 07:07:52 -08:00
ObserverOfTime
6825dc63b6 highlights(swift): fix captures 2022-11-26 13:17:51 +02:00
Alex Pinkus
14edfee545 feat(swift): sync highlight queries with upstream
Upstream highlight queries have added support for Swift regex literals.
This change brings that support to nvim-treesitter.

Also includes some minor reordering of modifiers for logical consistency
(no impact on highlighting behavior).
2022-10-10 23:00:58 +02:00
Lewis Russell
37398c7d68 feat(spell): support more languages 2022-09-26 13:47:12 +01:00
Alex Pinkus
98d5fe400c highlights(swift): fix for_statement variable declaration
Incorporates a fix from upstream, caught due to the emacs tree-sitter
plugin using an older version of tree-sitter that does stricter
validation.
2022-09-05 21:16:04 +02:00
Stephan Seitz
24db489566 highlights(swift): add keywords "convenience", "required", "override" 2022-08-16 11:39:30 -07:00
Stephan Seitz
bb1c6c2475 highlights(swift): add keywords "actor", "nonisolated"
Introduced in 07bdffb5e6
2022-08-16 11:39:30 -07:00
lfenzo
c784720917 Split func/method definition from calls in several programming language queries 2022-08-03 12:05:30 -07:00
Christian Clason
c95496d8d6
feat(swift): update parser and queries to 0.3.0 (#3035)
also port upstream query changes
2022-06-19 14:18:16 +02:00
Stephan Seitz
cc1890528f highlights(swift): add more @operators and implicit keyword 2022-01-18 22:09:21 +01:00
Stephan Seitz
8025b90329 highlights(swift): highlight "->" as @operator 2022-01-18 22:09:21 +01:00
Stephan Seitz
a3c86fe843 highlights(swift): highlight punctuation
"?" is still missing:
https://github.com/tree-sitter/tree-sitter-swift/issues/38
2022-01-18 22:09:21 +01:00
Christian Clason
f3e554ed7b highlight(swift): add upstream queries 2022-01-16 14:27:24 +01:00