feat(treesitter): add injection language fallback (#24659)

* feat(treesitter): add injection language fallback

Problem: injection languages are often specified via aliases (e.g.,
filetype or in upper case), requiring custom directives.

Solution: include lookup logic (try as parser name, then filetype, then
lowercase) in LanguageTree itself and remove `#inject-language`
directive.

Co-authored-by: Lewis Russell <me@lewisr.dev>
This commit is contained in:
Christian Clason
2023-08-11 17:05:17 +02:00
committed by GitHub
parent 72e64a1afe
commit 31c4ed26bc
6 changed files with 39 additions and 54 deletions

View File

@@ -783,7 +783,7 @@ int x = INT_MAX;
return list
]]
eq({ 'gsub!', 'inject-language!', 'offset!', 'set!', 'trim!' }, res_list)
eq({ 'gsub!', 'offset!', 'set!', 'trim!' }, res_list)
end)
end)
end)