diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-02-23 23:50:55 -0500 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2023-02-24 13:38:20 -0800 |
| commit | e138c066f7e33464655bd064341483867c43d1fe (patch) | |
| tree | 25105ebccdcd3f8bd52aa715b8777f4b016f211f /lua | |
| parent | docs: add small note in README clarifying custom parser installation (#3625) (diff) | |
| download | nvim-treesitter-e138c066f7e33464655bd064341483867c43d1fe.tar nvim-treesitter-e138c066f7e33464655bd064341483867c43d1fe.tar.gz nvim-treesitter-e138c066f7e33464655bd064341483867c43d1fe.tar.bz2 nvim-treesitter-e138c066f7e33464655bd064341483867c43d1fe.tar.lz nvim-treesitter-e138c066f7e33464655bd064341483867c43d1fe.tar.xz nvim-treesitter-e138c066f7e33464655bd064341483867c43d1fe.tar.zst nvim-treesitter-e138c066f7e33464655bd064341483867c43d1fe.zip | |
feat(health): sort parser list for clarity
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index de31f4196..0eec2f116 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1570,12 +1570,14 @@ end -- Get a list of all available parsers ---@return string[] function M.available_parsers() + local parsers = vim.tbl_keys(M.list) + table.sort(parsers) if vim.fn.executable "tree-sitter" == 1 and vim.fn.executable "node" == 1 then - return vim.tbl_keys(M.list) + return parsers else return vim.tbl_filter(function(p) ---@param p string return not M.list[p].install_info.requires_generate_from_grammar - end, vim.tbl_keys(M.list)) + end, parsers) end end |
