neovim/runtime/lua/vim/treesitter
Riley Bruins b9b408a56c
feat(treesitter): start moving get_parser to return nil #30313
**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.
2024-09-13 05:09:11 -07:00
..
_fold.lua feat(treesitter): start moving get_parser to return nil #30313 2024-09-13 05:09:11 -07:00
_meta.lua feat(treesitter): add support for wasm parsers 2024-08-26 16:44:03 +02:00
_query_linter.lua feat(treesitter): start moving get_parser to return nil #30313 2024-09-13 05:09:11 -07:00
_range.lua docs(treesitter): generate inline docs for Ranges 2024-08-06 18:18:34 +02:00
dev.lua feat(treesitter): start moving get_parser to return nil #30313 2024-09-13 05:09:11 -07:00
health.lua feat(treesitter): add support for wasm parsers 2024-08-26 16:44:03 +02:00
highlighter.lua fix(treesitter): ensure syntaxset augroup exists (#29542) 2024-07-03 07:40:42 +08:00
language.lua feat(treesitter): add support for wasm parsers 2024-08-26 16:44:03 +02:00
languagetree.lua feat(treesitter)!: default to correct behavior for quantified captures (#30193) 2024-09-01 18:01:53 +00:00
query.lua feat(treesitter)!: default to correct behavior for quantified captures (#30193) 2024-09-01 18:01:53 +00:00