Commit graph

2135 commits

Author SHA1 Message Date
Pham Huy Hoang
80f66cdef1
injections(vue): inject typescript instead of js (#5577)
Interpolations (`{{valid js code}}`) and directive attributes
(`<element :directive="valid js code"`) can also be typescript code,
hence we can inject typescript instead of javascript here and still
be ok with highlights (bar some syntax differences between ts and js)
2023-11-06 11:04:13 +09:00
Ramkumar Ramachandra
b3d2c36254 mlir: update highlights.scm, parser 2023-11-05 13:36:18 +01:00
Brian Albert Monroe
c5a7533113
fix(rnoweb): add highlights query (#5622)
Add a placeholder highlights query files for rnoweb to enable treesitter highlighting
2023-11-03 22:51:41 +09:00
Veesh Goldman
a689957480 pod: fix highlights 2023-11-03 14:23:40 +02:00
Veesh Goldman
fca784da0e perl: fix highlights for builtins 2023-11-03 14:23:40 +02:00
Derek Stride
1920285ec1 fix(sql): update queries from upstream 2023-11-02 19:39:34 +01:00
Azad
198015cca1
fix(query): stricter match for extends directive (#5604) 2023-11-02 19:02:41 +09:00
Amaan Qureshi
051ce73fcd chore(odin): update highlights from upstream 2023-11-01 20:08:04 -04:00
aMOPel
aeb5ad8ae1
feat(nim): added nim parser and queries (#5556)
* feat(nim): added nim parser and queries

* correct scanner.cc to scanner.c

Co-authored-by: Christian Clason <c.clason@uni-graz.at>

* fix(nim): corrected capture for @function.macro

* feat(nim highlights): added @field capture for discriminator field in
object variant

* bumped parser version, adapted highlights.scm and condensed
injections.scm

* improved nim_format_string highlights.scm

* bump nim parser version again

* removed overlap between queries for generalized strings in
injections.scm

* improved formattin] in nim_format_string/injections.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* corrected asm parser name in injections.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* improved formatting in highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* removed @error capture from highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* improved wording in comment in highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* removed priority from (dot_expression left: @none) capture, since it's
at the end of the file anyways

* removed comments listing unused captures

* reverted @error capture in nim_format_string/highlights.scm back to
@none

* condensed string alternatives in injections.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* condensed string alternatives in injections.scm (second part)

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* added comment to explain reasoning behind priority use

* swapped order of @punctuation.delimiter and @operator to get rid of
superfluous comment

* moved macro and template keywords to @preproc capture

* removed priorities in highlights.scm and shifted @parameter capture
behind @type capture

* improved formatting in locals.scm

* added queries for missing cases of @definition.namespace capture in
locals.scm

* removed some trailing whitespace

* added @namespace queries for highlights.scm

* bumped parser version again

* removed superfluous @type capture

* removed `@type`s `has-ancestor` and removed `(_ (_ ...` structures,
but added priorities

* added missing @constant capture to some queries in highlights.scm

* fixed priority numbers so they work when injecting nim (in markdown)

* added @none captures back to injection targets

* added (assembly_statement) injection query

* added indent queries

* removed indents.scm again

* added some missing queries for dot_generic_call, concept_declaration and
pragma_statement

---------

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-10-30 20:35:51 +09:00
Amaan Qureshi
6f8387f05d fix(rust): add foreign_mod_item to folds 2023-10-30 04:30:30 -04:00
Veesh Goldman
c36681bb49 feat: bump perl 2023-10-29 20:56:01 +01:00
Ronan Arraes Jardim Chagas
a741b5dd0d Improve curly expression alignment 2023-10-29 01:37:31 +02:00
Ronan Arraes Jardim Chagas
639c22c52c Improve indentation in Julia language
This commit improves the indentation in the function declaration,
function call, and in the assignment expressions.
2023-10-29 01:37:31 +02:00
Ronan Arraes Jardim Chagas
a07ce2155b
Fix indent. of curly expressions and of ],} in BOL (#5580) 2023-10-27 21:53:58 +09:00
Ronan Arraes Jardim Chagas
1e58a81450
Fix Julia indentation after end and with parenthesis at the beginning of line (#5579) 2023-10-27 12:28:44 +00: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
Teddytrombone
16af5ef490
feat(typoscript) Added parser and queries for TypoScript (#5564)
* Added configuration for TypoScript

* Removed duplicated code; Applied folding suggestion

* Applied suggestions

* Update queries/typoscript/highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

---------

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-10-24 07:48:33 +00:00
Riley Bruins
74ea25f95d
feat(lua): highlight variadic expressions as builtin parameters (#5567) 2023-10-24 11:19:12 +09:00
Veesh Goldman
84544f5cd3
chore(perl): update parser 2023-10-23 14:40:18 -04:00
r001
0b50cf1592
fix(leo): highlights fixes (#5563)
* make sure affine_group has priority, so parens and comma will not be miscolored; added `annotation` as @attribute

* `then` is not used as conditional, so moved to keywords

* finalize function highlight added

* differentiate between constant and variable variable identifiers
2023-10-23 19:15:49 +09:00
Colin Kennedy
0179a89656
feat: add objdump to the supported languages (#5548) 2023-10-22 12:05:20 +03:00
Amaan Qureshi
6cb93819c9 feat: add GN (Generate Ninja) 2023-10-22 01:17:15 -04:00
r001
99988f6eb7
feat: leo parser and queries (#5542) 2023-10-22 10:23:02 +09:00
Tomasz N
ce2a9fb89a
fix(phpdoc): disable spell checking of attribute names (#5015) 2023-10-22 10:21:51 +09:00
Veesh Goldman
bb3f8f40b1 feat(perl)!: switch to tree-sitter-perl org's parser 2023-10-21 14:41:22 -04:00
Veesh Goldman
7c67a1a923 feat(pod): add tree-sitter-perl org's POD parser 2023-10-21 14:41:22 -04:00
Meet Mangukiya
cffa252f5e feat: add solidity folds 2023-10-21 14:40:19 -04:00
Benedikt Reinartz
8963bc8a91
feat(erlang): add missing keyword 'begin' 2023-10-21 00:00:18 -04:00
Raafat Turki
8ac3e313f5
feat(prisma): folding queries (#5541) 2023-10-21 12:04:23 +09:00
Pham Huy Hoang
605a650924
chore(wing): update queries from upstream (#5549) 2023-10-20 14:02:49 +00:00
Robert Jackson
4c9da29cbd
fix(scala): add for_expression locals
This change does two main things:

1. Indicate that `(for_expression)`'s introduce a `@scope` (this
   is the scope for the enumerators to be used within the loop).
2. Indicate that the `(identifiers)` within the `(enumerators)` are
   `@definition.var`s.

---

For the following example snippet:

```scala
val fruits = List("apple", "banana", "avocado", "papaya")

val countsToFruits = fruits.groupBy(fruit => fruit.count(_ == 'a'))

for ((count, fruits) <- countsToFruits) {
  println(s"with (fruits) 'a' × $count = $fruits")
}
```

The `count` and `fruits` identifiers are new definitions introduced by
the `for` expressions scope.
2023-10-15 18:43:34 +00:00
Robert Jackson
dba7d120e5
fix(scala): ensure function_definition is in parent scope 2023-10-15 18:40:36 +00:00
Stephan Seitz
159272a809
feat: add gstreamer pipeline syntax (gstlaunch) 2023-10-15 18:38:16 +00:00
zetashift
7eadc8715d
fix(unison): improve highlight queries 2023-10-15 18:36:15 +00: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
Carlos Afonso
981b13b886 refactor: improve readability 2023-10-15 14:34:32 -04:00
Carlos Afonso
bf87a16712 fix(php): fix indentation for in between braces 2023-10-15 14:34:32 -04:00
Riley Bruins
28e1361d4a fix(markdown): set block quote priority within allowed range 2023-10-15 14:34:08 -04:00
Riley Bruins
ea5f5fddad fix(markdown): give code blocks higher priority than block quotes 2023-10-15 14:34:08 -04:00
Robert Jackson
262e9b1e86 fix(scala): Mark (lambda_expression) without bindings as @defintition.parameters
When you have a lambda expression like:

```scala
val fruits = List("apple", "banana", "avocado", "papaya")

val countsToFruits = fruits.groupBy(fruit => fruit.count(_ == 'a'))

for ((count, fruits) <- countsToFruits) {
  println(s"with (fruits) 'a' × $count = $fruits")
}
```

The `fruit => fruit.count(_ == 'a')` lambda expression (note: without
wrapping parenthesis) does not create a `(binding)` node. Its syntax
tree is:

```
    (lambda_expression) ; [5:18 - 47]
     parameters: (identifier) ; [5:18 - 22]
     (call_expression) ; [5:27 - 47]
      function: (field_expression) ; [5:27 - 37]
       value: (identifier) ; [5:27 - 31]
       field: (identifier) ; [5:33 - 37]
      arguments: (arguments) ; [5:38 - 47]
       (infix_expression) ; [5:39 - 46]
        left: (wildcard) ; [5:39 - 39]
        operator: (operator_identifier) ; [5:41 - 42]
        right: (character_literal) ; [5:44 - 46]
```

That example just _happens_ to be **exactly** one of the example from
https://www.scala-lang.org/ ([see
playground](https://scastie.scala-lang.org/S0bkCiXkQiuOMXnlhWn46g)) 😁.
2023-10-15 14:33:21 -04:00
Marc Jakobi
d33dbdab01 feat(haskell): highlights improvements
- Consider functions with only one value on the rhs as variables
- Applied composition: `(f . g) <param>` -> `@function.call`
- View patterns
- `@field` in record update expression
- type_tuple and type_list as variables
- quantifier for `exp_apply (<rhs>)+ (variable)`
- type_tuple and type_list as variables
- Treat signatures with only one value on the rhs as variables
  (except for `IO a`) -> Fixes #5505.
- Remove redundant anchors from signature function queries.
- Move signature function queries to give them higher priority
- Scoped function types
- Add signature query to function with parameters query
2023-10-15 14:32:51 -04:00
Munif Tanjim
f8fcb0da06 fix(typescript): do not highlight undefined as variable 2023-10-15 13:15:22 +03:00
nsfisis
ad02fbcdfc
fix(php): highlight never as @type.builtin (#5522) 2023-10-14 21:04:06 +09:00
Ibrahim Delice
0d5c611e3f
feat(java): highlight var as @type.builtin 2023-10-13 18:12:18 -04:00
Ibrahim Delice
b59a1fa075
fix(java): move @ to @attribute 2023-10-13 21:08:05 +00:00
Kevin Durbin
168972a0d5 fix(injections): fix injection for hurl for new injection syntax 2023-10-13 17:42:03 +02:00
Marc Jakobi
783e5fc307
feat(nix): some highlight improvements
- functions
- builtin functions with prefix
- add test file
2023-10-12 19:04:55 +00:00
Marc Jakobi
0eb1a0ad1c
fix(haskell): prevent segfault due to anchorless queries (#5502) 2023-10-10 17:12:36 +09:00
ObserverOfTime
dfd4fb330f
feat: add nasm parser (#5475)
* feat: add nasm parser

* chore: update highlights

---------

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-10-09 11:28:28 +03:00
Mathew Polzin
3a2cc3161e
feat(authzed): add parser and highlight queries. (#5426)
* feat(authzed): add parser and highlight queries

* Update queries/authzed/highlights.scm

use `any-of` for list of alternative words.

Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>

* add injections queries file.

* Update queries/authzed/highlights.scm

* tweak whitespace

* fix errors with capture names.

* style(authzed): reformat highlights

* add self as maintainer

* Update lua/nvim-treesitter/parsers.lua

Co-authored-by: Christian Clason <c.clason@uni-graz.at>

* Add to lockfile and readme

* feat(authzed): Updates to queries and lockfile around newest Authzed parser changes.

* Update queries/authzed/highlights.scm

Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>

* Update queries/authzed/highlights.scm

Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>

* unnest here similarly to recommended elsewhere

* Update highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

---------

Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-10-07 10:43:35 +09:00