mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
highlights(rust): use @namespace for [(crate) (self) (super)]
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/3992
This commit is contained in:
parent
ab414f8b1c
commit
6a31d9086e
2 changed files with 37 additions and 19 deletions
|
|
@ -209,10 +209,10 @@
|
||||||
(type_cast_expression "as" @keyword.operator)
|
(type_cast_expression "as" @keyword.operator)
|
||||||
(qualified_type "as" @keyword.operator)
|
(qualified_type "as" @keyword.operator)
|
||||||
|
|
||||||
(use_list (self) @keyword)
|
(use_list (self) @namespace)
|
||||||
(scoped_use_list (self) @keyword)
|
(scoped_use_list (self) @namespace)
|
||||||
(scoped_identifier [(crate) (super) (self)] @keyword)
|
(scoped_identifier [(crate) (super) (self)] @namespace)
|
||||||
(visibility_modifier [(crate) (super) (self)] @keyword)
|
(visibility_modifier [(crate) (super) (self)] @namespace)
|
||||||
|
|
||||||
[
|
[
|
||||||
"else"
|
"else"
|
||||||
|
|
|
||||||
|
|
@ -76,21 +76,39 @@ local function check_assertions(file)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end, true)
|
end, true)
|
||||||
assert.True(
|
if assertion.expected_capture_name:match "^!" then
|
||||||
captures[assertion.expected_capture_name] or highlights[assertion.expected_capture_name],
|
assert.Falsy(
|
||||||
"Error in at "
|
captures[assertion.expected_capture_name:sub(2)] or highlights[assertion.expected_capture_name:sub(2)],
|
||||||
.. file
|
"Error in at "
|
||||||
.. ":"
|
.. file
|
||||||
.. (row + 1)
|
.. ":"
|
||||||
.. ":"
|
.. (row + 1)
|
||||||
.. (col + 1)
|
.. ":"
|
||||||
.. ': expected "'
|
.. (col + 1)
|
||||||
.. assertion.expected_capture_name
|
.. ': expected "'
|
||||||
.. '", captures: '
|
.. assertion.expected_capture_name
|
||||||
.. vim.inspect(vim.tbl_keys(captures))
|
.. '", captures: '
|
||||||
.. '", highlights: '
|
.. vim.inspect(vim.tbl_keys(captures))
|
||||||
.. vim.inspect(vim.tbl_keys(highlights))
|
.. '", highlights: '
|
||||||
)
|
.. vim.inspect(vim.tbl_keys(highlights))
|
||||||
|
)
|
||||||
|
else
|
||||||
|
assert.True(
|
||||||
|
captures[assertion.expected_capture_name] or highlights[assertion.expected_capture_name],
|
||||||
|
"Error in at "
|
||||||
|
.. file
|
||||||
|
.. ":"
|
||||||
|
.. (row + 1)
|
||||||
|
.. ":"
|
||||||
|
.. (col + 1)
|
||||||
|
.. ': expected "'
|
||||||
|
.. assertion.expected_capture_name
|
||||||
|
.. '", captures: '
|
||||||
|
.. vim.inspect(vim.tbl_keys(captures))
|
||||||
|
.. '", highlights: '
|
||||||
|
.. vim.inspect(vim.tbl_keys(highlights))
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue