Commit Graph

13 Commits (b49a1fca34c7585a7a3c44c8f4db0705bae2f823)

Author SHA1 Message Date
Chris Kipp b49a1fca34
chore: sync highlights back with nvim-treesitter (#148) 2023-01-15 11:16:57 +07:00
Eugene Yokota 00cfe78f27 Add tests for optional braces highlights
Fixes https://github.com/tree-sitter/tree-sitter-scala/issues/59
2023-01-13 15:04:49 +07:00
eugene yokota c110fbaece
Merge pull request #128 from eed3si9n/wip/fewer_braces
SIP-44 Fewer braces support
2023-01-12 14:36:28 +07:00
Eugene Yokota a5ee1d6053 Use storageclass
Problem
-------
Currently storage related modifiers use keyword.

Solution
--------
We should use `storageclass` for `private`, `protected`, and `inline`.
See also https://www.sublimetext.com/docs/scope_naming.html#storage

> Keywords that affect the storage of a variable, function or data structure should use the following scope. Examples include static, inline, const, public and private.
2023-01-12 11:34:30 +07:00
Eugene Yokota 710e5cccc5 Add the val y = x: Int example 2023-01-12 10:45:32 +07:00
Eugene Yokota ffcbfc90a9 SIP-44 Fewer braces support
Fixes https://github.com/tree-sitter/tree-sitter-scala/issues/127

Problem
-------
Currently our grammar does not support the fewer braces syntax,
which basically lets us pass the last argument as a block after `:`.

Solution
--------
This implements fewer braces support for call_expression,
infix_expression, with and without the lambda start.
2023-01-12 10:45:32 +07:00
Anton Sviridov 94b7758931 Export clauses 2023-01-10 10:34:18 +07:00
Anton Sviridov cbf8207f4c
Extra highlights for scala 3 constructs (#120) 2023-01-10 09:59:00 +07:00
Anton Sviridov 6120785552
Transparent, open, infix (#119) 2023-01-10 09:03:36 +07:00
Eugene Yokota bf4102c863 Include operator-like identifier as simple expression
Problem
-------
Currently operator-like identifiers are not part of the simple
expression, so you can't call `::(123)`.

Solution
--------
This includes `$.operator_identifier` into `_simple_expression`,
and further improves the expression hierarchy.

Note that this removes test on double-prefix-expression.
It's not allowed in Scala spec to have double-prefix.
2023-01-09 18:54:50 +07:00
Anton Sviridov 80cb5ed88f Inline def, if, given, match 2023-01-09 22:48:08 +07:00
Anton Sviridov f05407f2f6 Scala 3 enums: fix simple case inheritance 2023-01-09 21:43:23 +07:00
Anton Sviridov c69a3eccc8 Update query highlights and add tests 2023-01-08 13:42:33 +07:00