Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make sure queries are copied to the right place #286

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
- name: copy nvim-treesitter queries
if: ${{ runner.os == 'Linux' }}
shell: bash
run: cp ./nvim_treesitter/queries/scala/*.scm ./queries/
run: cp ./nvim_treesitter/queries/scala/*.scm ./queries/scala/

- name: Check if queries are out of sync with nvim-treesitter
if: ${{ runner.os == 'Linux' }}
Expand Down
9 changes: 7 additions & 2 deletions queries/scala/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,13 @@

"return" @keyword.return

(comment) @comment @spell
(block_comment) @comment @spell
[
(comment)
(block_comment)
] @comment @spell

((block_comment) @comment.documentation
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))

;; `case` is a conditional keyword in case_block

Expand Down
35 changes: 24 additions & 11 deletions queries/scala/locals.scm
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
(template_body) @local.scope
(lambda_expression) @local.scope
; Scopes

[
(template_body)
(lambda_expression)
(function_definition)
(block)
] @scope

; References

(identifier) @reference

; Definitions

(function_declaration
name: (identifier) @local.definition) @local.scope
name: (identifier) @definition.function)

(function_definition
name: (identifier) @local.definition)
name: (identifier) @definition.function)

(parameter
name: (identifier) @local.definition)
name: (identifier) @definition.parameter)

(class_parameter
name: (identifier) @definition.parameter)

(binding
name: (identifier) @local.definition)
name: (identifier) @definition.var)

(val_definition
pattern: (identifier) @local.definition)
pattern: (identifier) @definition.var)

(var_definition
pattern: (identifier) @local.definition)
pattern: (identifier) @definition.var)

(val_declaration
name: (identifier) @local.definition)
name: (identifier) @definition.var)

(var_declaration
name: (identifier) @local.definition)
name: (identifier) @definition.var)

(identifier) @local.reference