Lewis Russell
8714a4009c
feat(treesitter): add filetype -> lang API
...
Problem:
vim.treesitter does not know how to map a specific filetype to a parser.
This creates problems since in a few places (including in vim.treesitter itself), the filetype is incorrectly used in place of lang.
Solution:
Add an API to enable this:
- Add vim.treesitter.language.add() as a replacement for vim.treesitter.language.require_language().
- Optional arguments are now passed via an opts table.
- Also takes a filetype (or list of filetypes) so we can keep track of what filetypes are associated with which langs.
- Deprecated vim.treesitter.language.require_language().
- Add vim.treesitter.language.get_lang() which returns the associated lang for a given filetype.
- Add vim.treesitter.language.register() to associate filetypes to a lang without loading the parser.
2023-02-21 17:09:18 +00:00
..
2023-02-22 00:07:26 +08:00
2022-10-18 07:18:44 -07:00
2023-02-22 00:07:26 +08:00
2023-02-22 00:07:26 +08:00
2022-12-05 21:09:31 +08:00
2022-12-02 16:05:00 +01:00
2023-02-21 23:50:29 +08:00
2019-05-09 20:27:11 -04:00
2023-02-22 00:07:26 +08:00
2022-12-02 16:05:00 +01:00
2023-02-22 00:07:26 +08:00
2023-01-12 08:57:39 -08:00
2023-02-03 09:18:18 +01:00
2022-11-24 10:23:50 +00:00
2023-01-01 15:05:13 +01:00
2023-01-07 08:19:37 -07:00
2023-02-22 00:07:26 +08:00
2023-02-21 23:50:29 +08:00
2023-02-03 09:18:18 +01:00
2022-10-14 08:01:13 -07:00
2021-09-10 08:48:27 +02:00
2022-02-27 11:56:30 +01:00
2022-10-29 17:41:22 +02:00
2023-01-01 15:05:13 +01:00
2023-01-01 15:05:13 +01:00
2023-01-01 15:05:13 +01:00
2023-02-22 00:07:26 +08:00
2023-01-01 15:05:13 +01:00
2023-02-22 00:07:26 +08:00
2023-02-21 23:50:29 +08:00
2022-10-14 08:01:13 -07:00
2023-01-01 15:05:13 +01:00
2023-02-21 23:50:29 +08:00
2023-02-21 23:50:29 +08:00
2023-02-22 00:07:26 +08:00
2022-12-02 16:05:00 +01:00
2022-12-02 16:05:00 +01:00
2023-01-24 18:04:15 +00:00
2023-01-15 12:08:03 +01:00
2023-02-04 14:58:38 +00:00
2022-12-02 16:05:00 +01:00
2023-02-09 13:15:29 +01:00
2023-02-21 23:50:29 +08:00
2023-01-01 15:05:13 +01:00
2022-12-05 21:09:31 +08:00
2022-10-14 08:01:13 -07:00
2023-02-22 00:07:26 +08:00
2023-02-21 17:09:18 +00:00
2023-02-22 00:07:26 +08:00
2022-12-11 18:41:26 -08:00
2023-02-21 23:50:29 +08:00
2023-02-21 23:50:29 +08:00
2018-10-29 09:55:07 +01:00
2022-10-23 04:04:23 -07:00
2022-10-06 06:16:00 -07:00
2023-02-21 23:50:29 +08:00
2018-10-29 09:55:07 +01:00
2023-01-01 15:05:13 +01:00
2022-11-10 09:05:25 +00:00
2015-08-15 15:25:30 -03:00
2022-10-29 17:41:22 +02:00
2023-02-22 00:07:26 +08:00
2023-02-03 09:18:18 +01:00
2023-01-09 17:12:06 +00:00
2022-03-23 19:52:50 +08:00
2023-02-22 00:07:26 +08:00
2023-02-21 23:50:29 +08:00
2023-02-21 23:50:29 +08:00
2023-01-01 15:05:13 +01:00
2022-10-14 08:01:13 -07:00
2022-07-06 19:34:24 +08:00
2023-02-21 23:50:29 +08:00
2023-02-06 10:01:38 +01:00
2023-02-22 00:07:26 +08:00
2022-11-20 18:42:30 +08:00
2023-02-21 23:50:29 +08:00
2022-09-26 17:43:23 +08:00
2023-02-20 15:12:59 +08:00
2022-12-02 16:05:00 +01:00
2022-12-03 14:47:35 +08:00
2023-01-01 15:05:13 +01:00
2023-02-21 17:09:18 +00:00
2023-02-21 23:50:29 +08:00
2023-02-22 00:07:26 +08:00
2022-07-26 11:26:23 +02:00
2023-02-21 23:50:29 +08:00
2022-10-14 08:01:13 -07:00
2023-02-21 23:50:29 +08:00
2022-11-10 09:05:25 +00:00
2022-02-24 18:13:44 +08:00
2023-02-21 23:50:29 +08:00
2023-01-03 10:07:43 +00:00
2022-02-24 18:13:44 +08:00
2023-01-01 15:05:21 +01:00
2021-09-08 07:24:12 -07:00
2023-01-01 15:05:21 +01:00
2021-05-01 22:29:02 -04:00
2021-05-02 12:53:49 -04:00
2023-01-01 15:05:21 +01:00
2023-01-01 15:05:21 +01:00
2023-02-21 23:50:29 +08:00
2021-05-01 22:29:03 -04:00
2021-04-27 09:21:33 -04:00
2023-01-01 15:05:21 +01:00
2018-10-29 10:01:44 +01:00
2021-04-29 09:27:19 -04:00
2018-10-29 10:01:44 +01:00
2023-01-01 15:05:21 +01:00
2023-01-01 15:05:21 +01:00
2021-04-29 20:42:16 -04:00
2023-01-01 15:05:21 +01:00
2023-01-01 15:05:21 +01:00
2023-01-18 06:50:22 +08:00
2023-01-01 15:05:21 +01:00
2019-03-26 19:55:33 +01:00
2021-04-27 09:21:34 -04:00
2022-10-14 08:01:13 -07:00
2023-01-03 10:07:43 +00:00
2023-02-22 00:07:26 +08:00
2023-01-03 10:07:43 +00:00
2023-02-11 20:00:31 +08:00
2022-11-10 09:05:25 +00:00
2023-02-22 00:07:26 +08:00