feat: add the entire plugin
This commit is contained in:
parent
7eade50d05
commit
21b8cfb470
7 changed files with 382 additions and 5 deletions
41
lua/fugitive-ts/health.lua
Normal file
41
lua/fugitive-ts/health.lua
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
local M = {}
|
||||
|
||||
function M.check()
|
||||
vim.health.start('fugitive-ts.nvim')
|
||||
|
||||
if vim.fn.has('nvim-0.9.0') == 1 then
|
||||
vim.health.ok('Neovim 0.9.0+ detected')
|
||||
else
|
||||
vim.health.error('fugitive-ts.nvim requires Neovim 0.9.0+')
|
||||
end
|
||||
|
||||
local fugitive_loaded = vim.fn.exists(':Git') == 2
|
||||
if fugitive_loaded then
|
||||
vim.health.ok('vim-fugitive detected')
|
||||
else
|
||||
vim.health.warn('vim-fugitive not detected (required for this plugin to be useful)')
|
||||
end
|
||||
|
||||
local common_langs = { 'lua', 'python', 'javascript', 'typescript', 'rust', 'go', 'c', 'cpp' }
|
||||
local available = {}
|
||||
local missing = {}
|
||||
|
||||
for _, lang in ipairs(common_langs) do
|
||||
local ok = pcall(vim.treesitter.language.inspect, lang)
|
||||
if ok then
|
||||
table.insert(available, lang)
|
||||
else
|
||||
table.insert(missing, lang)
|
||||
end
|
||||
end
|
||||
|
||||
if #available > 0 then
|
||||
vim.health.ok('Treesitter parsers available: ' .. table.concat(available, ', '))
|
||||
end
|
||||
|
||||
if #missing > 0 then
|
||||
vim.health.info('Treesitter parsers not installed: ' .. table.concat(missing, ', '))
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue