mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 12:50:09 -04:00
Merge branch 'master' into lua-hl-functions
This commit is contained in:
commit
44f6aa85f5
7 changed files with 33 additions and 9 deletions
10
README.md
10
README.md
|
|
@ -287,7 +287,8 @@ You can also manually add query paths to the runtime path by adding this to your
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
Before doing anything run `:checkhealth nvim_treesitter`. This will help you find where the bug might come from.
|
Before doing anything make sure you have the latest version of this plugin and run `:checkhealth nvim_treesitter`.
|
||||||
|
This will help you find where the bug might come from.
|
||||||
|
|
||||||
### Feature `X` does not work for `{language}`...
|
### Feature `X` does not work for `{language}`...
|
||||||
|
|
||||||
|
|
@ -297,6 +298,13 @@ If everything is okay, then it might be an actual error.
|
||||||
|
|
||||||
In both cases, feel free to [open an issue here](https://github.com/nvim-treesitter/nvim-treesitter/issues/new/choose).
|
In both cases, feel free to [open an issue here](https://github.com/nvim-treesitter/nvim-treesitter/issues/new/choose).
|
||||||
|
|
||||||
|
### I get `Error detected while processing .../plugin/nvim-treesitter.vim` everytime I open Neovim
|
||||||
|
|
||||||
|
This is probably due to a change in a parser's grammar or its queries.
|
||||||
|
Try updating the parser that you suspect has changed (`:TSUpdate {language}`) or all of them (`:TSUpdate`).
|
||||||
|
If the error persists after updating all parsers,
|
||||||
|
please [open an issue](https://github.com/nvim-treesitter/nvim-treesitter/issues/new/choose).
|
||||||
|
|
||||||
### I experience weird highlighting issues similar to [#78](https://github.com/nvim-treesitter/nvim-treesitter/issues/78)
|
### I experience weird highlighting issues similar to [#78](https://github.com/nvim-treesitter/nvim-treesitter/issues/78)
|
||||||
|
|
||||||
This is a well known issue, which arise when the tree and the buffer are getting out of sync.
|
This is a well known issue, which arise when the tree and the buffer are getting out of sync.
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ function M.attach(bufnr)
|
||||||
mode = 'v'
|
mode = 'v'
|
||||||
end
|
end
|
||||||
local cmd = string.format(":lua require'nvim-treesitter.incremental_selection'.%s()<CR>", funcname)
|
local cmd = string.format(":lua require'nvim-treesitter.incremental_selection'.%s()<CR>", funcname)
|
||||||
api.nvim_buf_set_keymap(buf, mode, mapping, cmd, { silent = true })
|
api.nvim_buf_set_keymap(buf, mode, mapping, cmd, { silent = true, noremap = true })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ function M.attach(bufnr)
|
||||||
for fn_name, mapping in pairs(config.keymaps) do
|
for fn_name, mapping in pairs(config.keymaps) do
|
||||||
local cmd = string.format([[:lua require'nvim-treesitter.refactor.navigation'.%s(%d)<CR>]], fn_name, bufnr)
|
local cmd = string.format([[:lua require'nvim-treesitter.refactor.navigation'.%s(%d)<CR>]], fn_name, bufnr)
|
||||||
|
|
||||||
api.nvim_buf_set_keymap(bufnr, 'n', mapping, cmd, { silent = true })
|
api.nvim_buf_set_keymap(bufnr, 'n', mapping, cmd, { silent = true, noremap = true })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ function M.attach(bufnr)
|
||||||
|
|
||||||
for fn_name, mapping in pairs(config.keymaps) do
|
for fn_name, mapping in pairs(config.keymaps) do
|
||||||
local cmd = string.format([[:lua require'nvim-treesitter.refactor.smart_rename'.%s(%d)<CR>]], fn_name, bufnr)
|
local cmd = string.format([[:lua require'nvim-treesitter.refactor.smart_rename'.%s(%d)<CR>]], fn_name, bufnr)
|
||||||
api.nvim_buf_set_keymap(bufnr, 'n', mapping, cmd, { silent = true })
|
api.nvim_buf_set_keymap(bufnr, 'n', mapping, cmd, { silent = true, noremap = true })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,8 @@ function M.attach(bufnr, lang)
|
||||||
end
|
end
|
||||||
if query then
|
if query then
|
||||||
local cmd = ":lua require'nvim-treesitter.textobjects'.select_textobject('"..query.."')<CR>"
|
local cmd = ":lua require'nvim-treesitter.textobjects'.select_textobject('"..query.."')<CR>"
|
||||||
api.nvim_buf_set_keymap(buf, "o", mapping, cmd, {silent = true})
|
api.nvim_buf_set_keymap(buf, "o", mapping, cmd, {silent = true, noremap = true })
|
||||||
api.nvim_buf_set_keymap(buf, "v", mapping, cmd, {silent = true})
|
api.nvim_buf_set_keymap(buf, "v", mapping, cmd, {silent = true, noremap = true })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
"|"
|
"|"
|
||||||
"--"
|
"--"
|
||||||
"__"
|
"__"
|
||||||
|
":"
|
||||||
"::"
|
"::"
|
||||||
"bullet"
|
"bullet"
|
||||||
"adornment"
|
"adornment"
|
||||||
|
|
@ -32,10 +33,12 @@
|
||||||
[
|
[
|
||||||
(literal_block)
|
(literal_block)
|
||||||
(line_block)
|
(line_block)
|
||||||
(block_quote)
|
|
||||||
(doctest_block)
|
(doctest_block)
|
||||||
] @text.literal
|
] @text.literal
|
||||||
|
|
||||||
|
(block_quote
|
||||||
|
(attribution)? @text.emphasis) @text.literal
|
||||||
|
|
||||||
(substitution_definition
|
(substitution_definition
|
||||||
name: (substitution) @constant)
|
name: (substitution) @constant)
|
||||||
|
|
||||||
|
|
@ -49,6 +52,16 @@
|
||||||
name: (reference)? @constant
|
name: (reference)? @constant
|
||||||
link: (_) @text.literal)
|
link: (_) @text.literal)
|
||||||
|
|
||||||
|
;; Lists
|
||||||
|
|
||||||
|
; Definition lists
|
||||||
|
(list_item
|
||||||
|
(term) @text.strong
|
||||||
|
(classifier)? @text.emphasis)
|
||||||
|
|
||||||
|
; Field lists
|
||||||
|
(field (field_name) @constant)
|
||||||
|
|
||||||
;; Inline markup
|
;; Inline markup
|
||||||
|
|
||||||
(emphasis) @text.emphasis
|
(emphasis) @text.emphasis
|
||||||
|
|
@ -110,8 +123,6 @@
|
||||||
|
|
||||||
(title) @text.title
|
(title) @text.title
|
||||||
|
|
||||||
(attribution) @text.emphasis
|
|
||||||
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
(comment "..") @comment
|
(comment "..") @comment
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,9 @@
|
||||||
name: (identifier) @type)
|
name: (identifier) @type)
|
||||||
(#match? @type "^[A-Z]"))
|
(#match? @type "^[A-Z]"))
|
||||||
|
|
||||||
|
(use_list (identifier) @type (#match? @type "^[A-Z]"))
|
||||||
|
(use_as_clause alias: (identifier) @type (#match? @type "^[A-Z]"))
|
||||||
|
|
||||||
;; Correct enum constructors
|
;; Correct enum constructors
|
||||||
(call_expression
|
(call_expression
|
||||||
function: (scoped_identifier
|
function: (scoped_identifier
|
||||||
|
|
@ -119,6 +122,8 @@
|
||||||
"type"
|
"type"
|
||||||
"union"
|
"union"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
"async"
|
||||||
|
"await"
|
||||||
"use"
|
"use"
|
||||||
"where"
|
"where"
|
||||||
(mutable_specifier)
|
(mutable_specifier)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue