Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions lua/CopilotChat/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,27 @@ function M.check()
start('CopilotChat.nvim [core]')

local is_nightly = vim.fn.has('nvim-0.10.0') == 1
local is_good_stable = vim.fn.has('nvim-0.9.5') == 1
if is_nightly then
ok('nvim: nightly')
else
elseif is_good_stable then
warn('nvim: stable, some features may not be available')
else
error('nvim: unsupported, please upgrade to 0.9.5 or later')
end

start('CopilotChat.nvim [commands]')

local curl_version = run_command('curl', '--version')
if curl_version == false then
error('curl: missing, required for API requests')
error('curl: missing, required for API requests. See "https://curl.se/".')
else
ok('curl: ' .. curl_version)
end

local git_version = run_command('git', '--version')
if git_version == false then
warn('git: missing, required for git-related commands')
warn('git: missing, required for git-related commands. See "https://git-scm.com/".')
else
ok('git: ' .. git_version)
end
Expand All @@ -69,7 +72,9 @@ function M.check()
if lualib_installed('plenary') then
ok('plenary: installed')
else
error('plenary: missing, required for running tests. Install plenary.nvim')
error(
'plenary: missing, required for http requests and async jobs. Install "nvim-lua/plenary.nvim" plugin.'
)
end

local has_copilot = lualib_installed('copilot')
Expand All @@ -78,26 +83,32 @@ function M.check()
ok('copilot: ' .. (has_copilot and 'copilot.lua' or 'copilot.vim'))
else
error(
'copilot: missing, required for 2 factor authentication. Install copilot.vim or copilot.lua'
'copilot: missing, required for 2 factor authentication. Install "github/copilot.vim" or "zbirenbaum/copilot.lua" plugins.'
)
end

if lualib_installed('tiktoken_core') then
ok('tiktoken_core: installed')
else
warn('tiktoken_core: missing, optional for token counting.')
warn(
'tiktoken_core: missing, optional for token counting. See README for installation instructions.'
)
end

if treesitter_parser_available('markdown') then
ok('treesitter[markdown]: installed')
else
warn('treesitter[markdown]: missing, optional for better chat highlighting')
warn(
'treesitter[markdown]: missing, optional for better chat highlighting. Install "nvim-treesitter/nvim-treesitter" plugin and run ":TSInstall markdown".'
)
end

if treesitter_parser_available('diff') then
ok('treesitter[diff]: installed')
else
warn('treesitter[diff]: missing, optional for better diff highlighting')
warn(
'treesitter[diff]: missing, optional for better diff highlighting. Install "nvim-treesitter/nvim-treesitter" plugin and run ":TSInstall diff".'
)
end
end

Expand Down