aboutsummaryrefslogtreecommitdiffstats
path: root/queries/scala
Commit message (Collapse)AuthorAgeFilesLines
* feat!: drop modules, general refactor and cleanupChristian Clason2025-05-124-381/+0
|
* fix(scala): remove unused ruleAmaan Qureshi2024-10-161-2/+0
|
* feat(highlights): capture wildcard patterns as `@character.special` (#7153)Omar Valdez2024-09-201-1/+2
|
* feat(highlights): capture wildcard imports as `@character.special`Omar Valdez2024-08-011-1/+5
|
* feat(scala): add some missing highlightsRiley Bruins2024-06-151-1/+14
|
* feat: more `@keyword.type` capturesRiley Bruins2024-05-011-4/+7
|
* refactor(format): drop extra indentation for fieldPhạm Huy Hoàng2024-03-212-8/+6
|
* feat(highlights)!: `@keyword.storage` → `@keyword.modifier`Jaehwang Jung2024-03-161-1/+1
|
* feat(highlights)!: keyword `@type.qualifier` → `@keyword.modifier`Jaehwang Jung2024-03-161-4/+4
|
* chore: format queriesPhạm Huy Hoàng2024-01-212-7/+6
|
* fix(highlights): improve member/property distinctionObserverOfTime2024-01-191-1/+1
|
* fix(highlights): improve consistencyObserverOfTime2024-01-191-1/+2
|
* chore: query formattingPham Huy Hoang2024-01-194-88/+115
|
* feat!: align standard captures with upstreamChristian Clason2024-01-191-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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" (https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/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`
* feat(locals)!: switch to upstream capturesChristian Clason2024-01-191-13/+13
|
* fix(scala): add `for_expression` localsRobert Jackson2023-10-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* fix(scala): ensure `function_definition` is in parent scopeRobert Jackson2023-10-151-1/+2
|
* fix(scala): Mark (lambda_expression) without bindings as @defintition.parametersRobert Jackson2023-10-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)) 😁.
* chore(injections)!: update injection syntax to 0.9Pham Huy Hoang2023-08-121-4/+5
| | | | | | | | | 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
* feat(scala): sync highlights with latest upstream (#4926)Chris Kipp2023-06-091-1/+4
| | | | | | This accounts for a correction in interpolations and also adding support for `self_type`. This is a follow-up to #4920.
* fix(scala): add `block_comment`Domas Poliakas2023-06-062-3/+9
|
* highlights(scala): add support for using directives (#4893)Chris Kipp2023-06-021-0/+4
| | | This accounts for the updates in https://github.com/tree-sitter/tree-sitter-scala/pull/273.
* fix: Correct scope definition for scalaKasper Kondzielski2023-04-281-1/+1
| | | `@scope` included `function_declaration` while is should have included `function_definition` instead. The former one is used to declare abstract functions while the latter one is used to define functions together with their bodies.
* fix(scala): Add missing locals definitions for scalaghostbuster912023-04-011-0/+4
|
* feat(scala): add in local variables queriesChris Kipp2023-03-271-0/+38
| | | | | | This syncs the queries that were updated in https://github.com/tree-sitter/tree-sitter-scala/pull/196. Co-authored-by: ghostbuster91 <ghostbuster91@users.noreply.github.com>
* feat: add `@comment.documentation` where applicableAmaan Qureshi2023-03-051-0/+3
|
* refactor(scala): update scala highlights for uppercase identifiersChris Kipp2023-01-211-1/+1
| | | | | | | | | This is a small change that comes from the discussion we had in https://github.com/tree-sitter/tree-sitter-scala/discussions/168#discussioncomment-4718624. The idea here is that we're sort of making an assumption on what an uppercase identifier is in Scala and more times than not, it's actually a `@type`. So this changes the `@constant` capture to a `@type` one. You can find the full context in the linked discussion.
* scala: add interpolator query (#4175)Chris Kipp2023-01-181-3/+3
|
* sync with latest Scala and add bindingChris Kipp2023-01-151-0/+3
|
* refactor(scala): update the Scala highlight queriesChris Kipp2023-01-141-47/+85
| | | | | | | | | | | | | | | | | There has been a lot of changes recently to the Scala grammar and we've been merging in a handful of things before syncing the actual generated parser. We are currently at a stage where we're going to sync everything, but there are some breaking changes that are included in https://github.com/tree-sitter/tree-sitter-scala/pull/135, so when that commit gets synced here stuff will break. We've taken the queries that existed here and have been building off of them in the actual upstream repo. This will hopefully make the transition smooth and updates the queries to ensure that there is no breakage. It's recommended to wait until that pr is merged, synced here, and then merge this in around the same time. Co-authored-by: eugene yokota <eed3si9n@gmail.com> Co-authored-by: Anton Sviridov <keynmol@gmail.com>
* highlights(scala): use more specific groupsObserverOfTime2022-11-261-10/+16
|
* feat(spell): support more languagesLewis Russell2022-09-261-1/+1
|
* Split func/method definition from calls in several programming language querieslfenzo2022-08-031-3/+3
|
* Prefer lua-match over matchLewis Russell2021-11-231-8/+8
| | | | as string.find is much quicker than vim.regex:match*
* chore: fix typosDundar Göc2021-11-021-2/+2
|
* Add scala maintainerStevan Milic2021-10-071-0/+1
| | | | Add fold for scala val definition to support type class entries
* Add scala foldsStevan Milic2021-09-042-2/+17
|
* Update scala highlightsStevan Milic2021-09-042-1/+36
| | | | | | | | | | | | * add highlights for imports * add highlights for type constructors * add highlights for constants * add highlights for interpolation string * add highlights for comments through injection
* update scala highlights (#1760)Stevan Milic2021-08-281-5/+78
| | | | | | | | | | | | | | | | | | | * add type highlights * add call expression highlights * add function definition highlights * add expression highlights * add literals highlights * add operator highlights * add punctuation highlights * add comment highlights Co-authored-by: Stevan Milic <stevan.milic@tradecore.com>
* add keywords to scala highlights (#1662)Stuart Mashaal2021-08-251-0/+96
* add keywords to scala highlights * special capture for special keywords * add while to 'repeat' capture * pr cleanup, exmaples in CONTRIBUTING.md * add backquotes for consistency in docs * group @repeat keywords, fix null * comment-out 'macro' and 'forSome' * fix 'this' and 'super' keyword * remove accidental files :facepalm: * update revision * fix "super" and "this" * godammit these .metals files are killing me * why did I commit this??? Co-authored-by: Stuart Mashaal <smashaal@hopper.com>