aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter/query.lua
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-09-14 13:27:44 +0200
committerChristian Clason <c.clason@uni-graz.at>2024-09-29 15:27:16 +0200
commit041d98fe8d892a81ed659c32be5360d4f80e7d18 (patch)
tree991483e2cbdfe39bf1304e6de961e1b4890df3f7 /runtime/lua/vim/treesitter/query.lua
parente40314811ec7a123a7fcfa73c7712cdb7a11ddf3 (diff)
downloadrneovim-041d98fe8d892a81ed659c32be5360d4f80e7d18.tar.gz
rneovim-041d98fe8d892a81ed659c32be5360d4f80e7d18.tar.bz2
rneovim-041d98fe8d892a81ed659c32be5360d4f80e7d18.zip
feat(treesitter)!: add default fallback to `ft_to_lang` lookups
Problem: Language names are only registered for filetype<->language lookups when parsers are actually loaded; this means users cannot rely on `vim.treesitter.language.get_lang()` or `get_filetypes()` to return the correct value when language and filetype coincide and always need to add explicit fallbacks. Solution: Always return the language name as valid filetype in `get_filetypes()`, and default to the filetype in `get_lang()`. Document this behavior.
Diffstat (limited to 'runtime/lua/vim/treesitter/query.lua')
0 files changed, 0 insertions, 0 deletions