mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
fix(treesitter): enforce lowercase language names (#28546)
* fix(treesitter): enforce lowercase language names Problem: On case-insensitive file systems (e.g., macOS), `has_parser` will return `true` for uppercase aliases, which will then try to inject the uppercase language unsuccessfully. Solution: Enforce and assume parser names to be lowercase when resolving language names.
This commit is contained in:
@@ -484,7 +484,7 @@ describe('treesitter highlighting (C)', function()
|
||||
exec_lua [[
|
||||
vim.treesitter.language.register("c", "foo")
|
||||
local parser = vim.treesitter.get_parser(0, "c", {
|
||||
injections = {c = '(preproc_def (preproc_arg) @injection.content (#set! injection.language "fOO")) (preproc_function_def value: (preproc_arg) @injection.content (#set! injection.language "fOO"))'}
|
||||
injections = {c = '(preproc_def (preproc_arg) @injection.content (#set! injection.language "foo")) (preproc_function_def value: (preproc_arg) @injection.content (#set! injection.language "foo"))'}
|
||||
})
|
||||
local highlighter = vim.treesitter.highlighter
|
||||
test_hl = highlighter.new(parser, {queries = {c = hl_query}})
|
||||
|
||||
Reference in New Issue
Block a user