mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 08:20:05 -04:00
feat: add @comment.documentation where applicable
This commit is contained in:
parent
3a82b58745
commit
5a87bc98da
32 changed files with 256 additions and 58 deletions
|
|
@ -196,20 +196,46 @@
|
|||
(float_literal) @float
|
||||
(imaginary_literal) @number
|
||||
|
||||
(true) @boolean
|
||||
(false) @boolean
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
] @boolean
|
||||
|
||||
(nil) @constant.builtin
|
||||
|
||||
(keyed_element
|
||||
. (literal_element (identifier) @field))
|
||||
(field_declaration name: (field_identifier) @field)
|
||||
|
||||
; Comments
|
||||
|
||||
(comment) @comment @spell
|
||||
|
||||
;; Doc Comments
|
||||
|
||||
(source_file . (comment)+ @comment.documentation)
|
||||
|
||||
(source_file
|
||||
(comment)+ @comment.documentation
|
||||
. (const_declaration))
|
||||
|
||||
(source_file
|
||||
(comment)+ @comment.documentation
|
||||
. (function_declaration))
|
||||
|
||||
(source_file
|
||||
(comment)+ @comment.documentation
|
||||
. (type_declaration))
|
||||
|
||||
(source_file
|
||||
(comment)+ @comment.documentation
|
||||
. (var_declaration))
|
||||
|
||||
; Errors
|
||||
|
||||
(ERROR) @error
|
||||
|
||||
; Spell
|
||||
|
||||
((interpreted_string_literal) @spell
|
||||
(#not-has-parent? @spell
|
||||
import_spec
|
||||
)
|
||||
)
|
||||
(#not-has-parent? @spell import_spec))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue