mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
b9b408a56c
**Problem:** `vim.treesitter.get_parser` will throw an error if no parser can be found. - This means the caller is responsible for wrapping it in a `pcall`, which is easy to forget - It also makes it slightly harder to potentially memoize `get_parser` in the future - It's a bit unintuitive since many other `get_*` style functions conventionally return `nil` if no object is found (e.g. `get_node`, `get_lang`, `query.get`, etc.) **Solution:** Return `nil` if no parser can be found or created - This requires a function signature change, and some new assertions in places where the parser will always (or should always) be found. - This commit starts by making this change internally, since it is breaking. Eventually it will be rolled out to the public API. |
||
---|---|---|
.. | ||
bump_deps.lua | ||
cdoc_grammar.lua | ||
cdoc_parser.lua | ||
check_urls.vim | ||
cliff.toml | ||
download-unicode-files.sh | ||
gen_eval_files.lua | ||
gen_filetype.lua | ||
gen_help_html.lua | ||
gen_lsp.lua | ||
gen_vimdoc.lua | ||
genappimage.sh | ||
lintcommit.lua | ||
lintdoc.lua | ||
luacats_grammar.lua | ||
luacats_parser.lua | ||
release.sh | ||
shadacat.py | ||
text_utils.lua | ||
update_terminfo.sh | ||
vim-patch.sh | ||
vimpatch.lua | ||
windows.ti |