Merge branch 'master' into lua-hl-functions

This commit is contained in:
Thomas Vigouroux 2020-08-09 18:35:31 +02:00 committed by GitHub
commit 44f6aa85f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 9 deletions

View file

@ -287,7 +287,8 @@ You can also manually add query paths to the runtime path by adding this to your
## 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}`...
@ -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).
### 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)
This is a well known issue, which arise when the tree and the buffer are getting out of sync.

View file

@ -105,7 +105,7 @@ function M.attach(bufnr)
mode = 'v'
end
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

View file

@ -56,7 +56,7 @@ function M.attach(bufnr)
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)
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

View file

@ -51,7 +51,7 @@ function M.attach(bufnr)
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)
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

View file

@ -86,8 +86,8 @@ function M.attach(bufnr, lang)
end
if query then
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, "v", 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, noremap = true })
end
end
end

View file

@ -5,6 +5,7 @@
"|"
"--"
"__"
":"
"::"
"bullet"
"adornment"
@ -32,10 +33,12 @@
[
(literal_block)
(line_block)
(block_quote)
(doctest_block)
] @text.literal
(block_quote
(attribution)? @text.emphasis) @text.literal
(substitution_definition
name: (substitution) @constant)
@ -49,6 +52,16 @@
name: (reference)? @constant
link: (_) @text.literal)
;; Lists
; Definition lists
(list_item
(term) @text.strong
(classifier)? @text.emphasis)
; Field lists
(field (field_name) @constant)
;; Inline markup
(emphasis) @text.emphasis
@ -110,8 +123,6 @@
(title) @text.title
(attribution) @text.emphasis
(comment) @comment
(comment "..") @comment

View file

@ -43,6 +43,9 @@
name: (identifier) @type)
(#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
(call_expression
function: (scoped_identifier
@ -119,6 +122,8 @@
"type"
"union"
"unsafe"
"async"
"await"
"use"
"where"
(mutable_specifier)