Commit graph

46 commits

Author SHA1 Message Date
再生花
31641d72a4
feat(format-scripts): linewrap predicates
"format-ignore".kick()
2024-02-23 10:42:01 +02: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
2f38c36294 fix(highlights): improve consistency 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
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
Alexander Sieg
6608e2c868
fix(elixir): highlight functions without parenthesis (#5511)
Elixir does not require parenthesis after the function name for a
valid function definition.
2023-10-15 18:35:08 +00: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
Amaan Qureshi
85330918f0 perf: remove match where possible 2023-04-21 18:24:17 -04:00
George Harker
cb568af539 use indent.X syntax for captures and properties of set directives
update CONTRIBUTING.md

adjust indents for bass

fix doc capture comment
2023-03-24 13:07:53 -04:00
Amaan Qureshi
5a87bc98da feat: add @comment.documentation where applicable 2023-03-05 17:15:32 -05:00
Stephen Bolton
a744ed1b27 Fix elixir @function captures
When viewing the previous rule in the `TSPlayground` the `@function`
captures were not actually matching. This led all functions to get the
`@function.call` group applied to them. This change makes it so that the
capture now works and where functions are defined will get the
`@function` group.
2023-02-24 17:50:17 -05:00
ObserverOfTime
27e1f3c336 highlights(elixir): fix captures 2022-11-26 13:17:51 +02:00
Lewis Russell
2a63ea5665 feat(spell): upstream spell queries from spellsitter 2022-09-06 12:44:19 +01:00
lfenzo
c784720917 Split func/method definition from calls in several programming language queries 2022-08-03 12:05:30 -07:00
Connor Lay (Clay)
5045086793 Fix Elixir indents to match mix format 2022-02-10 07:24:08 +01:00
Clay
2532937ba1
Add tree-sitter-eex parser for (L)EEx files (#2351) 2022-01-25 16:52:51 +00:00
Clay
c7d5ba7212 Add new Elixir language injections 2022-01-24 08:27:44 +01:00
Clay
7a1c404fe7 Fix highlights of module attributes and doc sigils 2022-01-24 08:27:44 +01:00
Łukasz Niemier
6372b689eb fix: use more specific identifier check 2021-11-12 13:42:36 -05:00
Łukasz Niemier
fdcd0edf24 fix: make comment doc highlighting work for any doc tag 2021-11-12 13:42:36 -05:00
Łukasz Niemier
2c2d4d89fd fix: Elixir non-doc sigils will no longer be flickering
It also adds support for colouring documentation metadata attributes
(ex. `@doc foo: :bar`).
2021-11-12 13:42:36 -05:00
Clay
97819053c8
Elixir: fix a few highlights, add ExUnit support to locals (#1933)
* Fix "not in" and sigil highlights

* Add ExUnit test case to locals

* Update README to mention new Elixir parser
2021-10-22 16:33:01 -05:00
Connor Lay (Clay)
638891d401 Highlight and,or,not,in as @keyword.operator 2021-10-13 01:31:49 +02:00
Connor Lay (Clay)
6bd551d3b7 Fix documentation highlights, formatting 2021-10-13 01:31:49 +02:00
Connor Lay (Clay)
725ef8fc18 Locals matching "when" operator, add pipe queries 2021-10-13 01:31:49 +02:00
Connor Lay (Clay)
25b28f6185 Increase Elixir locals pattern match depth to 20 nodes
This requires an update to `ts_query_cursor_set_match_limit` to
function properly. The current limit is 32 per this PR
https://github.com/neovim/neovim/pull/14915, increasing this value
to 128 appears to work, but more testing will be necessary.

Exposing this limit as a neovim option is worth exploring as a separate
unit of work.
2021-10-13 01:31:49 +02:00
Connor Lay (Clay)
1413f62c88 Update locals with support for deep pattern matches 2021-10-13 01:31:49 +02:00
Connor Lay (Clay)
259e3f6e64 Update indents & fix catch highlights 2021-10-13 01:31:49 +02:00
Connor Lay (Clay)
886261a96b Update injections & highlights, add folds 2021-10-13 01:31:49 +02:00
Connor Lay (Clay)
ec5341a773 Update injections for new elixir-lang parser 2021-10-13 01:31:49 +02:00
Connor Lay (Clay)
e0125a5a1c Update highlights for new elixir-lang parser 2021-10-13 01:31:49 +02:00
Clay
57c2081e3f Add HEEx language support, add missing commentstrings 2021-08-18 14:07:59 +02:00
Connor Lay (Clay)
d06ab28766
Fix: Improve Elixir highlighting performance (#1682) 2021-08-13 12:09:16 -05:00
Connor Lay (Clay)
6944173e87
Feature: Add Surface language and integrate with Elixir (#1645)
* Add initial surface highlights & injections

* Additional surface highlights

* Filetype detection, fix injections

* Fix Elixir function highlight when left is an identifier

* Add surface parser

* Fix comment highlights

* Surface folds, indents, better highlights

* Highlight surface components & directives

* Restore comments Elixir injections
2021-08-01 19:09:41 +00:00
Łukasz Niemier
21a7f61b06 fix(elixir): add missing possible parameters 2021-07-18 16:44:35 +00:00
Mitchell Hanberg
f6cd2d0b2f
[elixir] Add folds (#1543) 2021-07-09 18:51:16 +00:00
David Bernheisel
ad28bbf04c Add regex injection for Elixir 2021-06-01 22:04:52 +02:00
Daniel Kempkens
ea8482621e Elixir: Highlight with as conditional
`with` is also considered a conditional in Elixir. Highlight it
accordingly.
2021-05-27 22:02:30 +02:00
Daniel Kempkens
a98e5c1f4f Refactor highlights and locals queries 2021-05-18 19:10:06 +02:00
Daniel Kempkens
a04b0abf21 Use #any-of? in locals 2021-05-18 19:10:06 +02:00
Daniel Kempkens
e7e1db38cd Initial Elixir support 2021-05-18 19:10:06 +02:00