mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 16:30:02 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
310f0925ec
commit
692b051b09
1247 changed files with 6096 additions and 9074 deletions
5
runtime/queries/http/folds.scm
Normal file
5
runtime/queries/http/folds.scm
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[
|
||||
(section)
|
||||
(json_body)
|
||||
(variable_declaration)+
|
||||
] @fold
|
||||
64
runtime/queries/http/highlights.scm
Normal file
64
runtime/queries/http/highlights.scm
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
; Methods
|
||||
(method) @function.method
|
||||
|
||||
; Headers
|
||||
(header
|
||||
name: (_) @constant)
|
||||
|
||||
(header
|
||||
value: (_) @string)
|
||||
|
||||
; Variables
|
||||
(identifier) @variable
|
||||
|
||||
(variable_declaration
|
||||
"@" @character.special)
|
||||
|
||||
(variable_declaration
|
||||
(value) @string)
|
||||
|
||||
; Operators
|
||||
(comment
|
||||
"=" @operator)
|
||||
|
||||
(variable_declaration
|
||||
"=" @operator)
|
||||
|
||||
; keywords
|
||||
(comment
|
||||
"@" @keyword
|
||||
name: (_) @keyword)
|
||||
|
||||
; Literals
|
||||
(request
|
||||
url: (_) @string.special.url)
|
||||
|
||||
(http_version) @string.special
|
||||
|
||||
; Response
|
||||
(status_code) @number
|
||||
|
||||
(status_text) @string
|
||||
|
||||
; Punctuation
|
||||
[
|
||||
"{{"
|
||||
"}}"
|
||||
"{%"
|
||||
"%}"
|
||||
] @punctuation.bracket
|
||||
|
||||
">" @punctuation.special
|
||||
|
||||
(header
|
||||
":" @punctuation.delimiter)
|
||||
|
||||
; external JSON body
|
||||
(external_body
|
||||
path: (_) @string.special.path)
|
||||
|
||||
; Comments
|
||||
[
|
||||
(comment)
|
||||
(request_separator)
|
||||
] @comment @spell
|
||||
24
runtime/queries/http/injections.scm
Normal file
24
runtime/queries/http/injections.scm
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
; Comments
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
; Body
|
||||
((json_body) @injection.content
|
||||
(#set! injection.language "json"))
|
||||
|
||||
((xml_body) @injection.content
|
||||
(#set! injection.language "xml"))
|
||||
|
||||
((graphql_data) @injection.content
|
||||
(#set! injection.language "graphql"))
|
||||
|
||||
; Script (default to javascript)
|
||||
((comment
|
||||
name: (_) @_name
|
||||
(#eq? @_name "lang")
|
||||
value: (_) @injection.language)?
|
||||
.
|
||||
(_
|
||||
(script) @injection.content
|
||||
(#offset! @injection.content 0 2 0 -2))
|
||||
(#set! injection.language "javascript"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue