From 315d5d43fb159d073f8dec4fb960a42b0addb55f Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Mon, 9 Oct 2023 10:08:58 -0400 Subject: [PATCH] refactor!: remove nvim-treesitter dependency --- README.md | 4 ---- lua/neotest/lib/subprocess.lua | 1 - lua/neotest/lib/treesitter/init.lua | 2 +- tests/minimal_init.lua | 1 - 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index 8a9301dc..4e5745e4 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,6 @@ Install with your favourite package manager alongside nvim-dap ```vim call dein#add("nvim-lua/plenary.nvim") -call dein#add("nvim-treesitter/nvim-treesitter") call dein#add("antoinemadec/FixCursorHold.nvim") call dein#add("nvim-neotest/neotest") ``` @@ -54,7 +53,6 @@ call dein#add("nvim-neotest/neotest") ```vim Plug 'nvim-lua/plenary.nvim' -Plug 'nvim-treesitter/nvim-treesitter' Plug 'antoinemadec/FixCursorHold.nvim' Plug 'nvim-neotest/neotest' ``` @@ -66,7 +64,6 @@ use { "nvim-neotest/neotest", requires = { "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", "antoinemadec/FixCursorHold.nvim" } } @@ -79,7 +76,6 @@ use { "nvim-neotest/neotest", dependencies = { "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", "antoinemadec/FixCursorHold.nvim" } } diff --git a/lua/neotest/lib/subprocess.lua b/lua/neotest/lib/subprocess.lua index c17e5bab..1120af0d 100644 --- a/lua/neotest/lib/subprocess.lua +++ b/lua/neotest/lib/subprocess.lua @@ -66,7 +66,6 @@ function neotest.lib.subprocess.init() { parent_address } ) -- Load dependencies - nio.fn.rpcrequest(child_chan, "nvim_exec_lua", "require('nvim-treesitter')", {}) nio.fn.rpcrequest(child_chan, "nvim_exec_lua", "require('plenary')", {}) enabled = true nio.api.nvim_create_autocmd("VimLeavePre", { callback = cleanup }) diff --git a/lua/neotest/lib/treesitter/init.lua b/lua/neotest/lib/treesitter/init.lua index 2cf626c5..e827cc84 100644 --- a/lua/neotest/lib/treesitter/init.lua +++ b/lua/neotest/lib/treesitter/init.lua @@ -114,7 +114,7 @@ end function neotest.lib.treesitter.get_parse_root(file_path, content, opts) local fast = opts.fast ~= false local ft = lib.files.detect_filetype(file_path) - local lang = require("nvim-treesitter.parsers").ft_to_lang(ft) + local lang = vim.treesitter.language.get_lang(ft) or ft nio.scheduler() local lang_tree = vim.treesitter.get_string_parser( content, diff --git a/tests/minimal_init.lua b/tests/minimal_init.lua index d2a81b74..f1114654 100644 --- a/tests/minimal_init.lua +++ b/tests/minimal_init.lua @@ -3,7 +3,6 @@ vim.notify = print vim.opt.rtp:append(".") vim.opt.rtp:append(lazypath .. "/plenary.nvim") vim.opt.rtp:append(lazypath .. "/nvim-dap") -vim.opt.rtp:append(lazypath .. "/nvim-treesitter") vim.opt.swapfile = false A = function(...) print(vim.inspect(...))