summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-04-07 12:00:41 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2021-04-07 13:00:42 +0200
commitbf0ae40cf4d185a589eb82349855ac3c03d073ae (patch)
tree93decd58323cebb7052c3a88840a0f7a2ae2951f /lua/nvim-treesitter
parent175c8c397c5fb7a84def279e22b2e3bd2dd13024 (diff)
fix(health): let CC check behave like in real installation
Fixes #1146
Diffstat (limited to 'lua/nvim-treesitter')
-rw-r--r--lua/nvim-treesitter/health.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua
index a97bb359..e2896cd0 100644
--- a/lua/nvim-treesitter/health.lua
+++ b/lua/nvim-treesitter/health.lua
@@ -3,6 +3,8 @@ local fn = vim.fn
local queries = require'nvim-treesitter.query'
local info = require'nvim-treesitter.info'
+local shell = require'nvim-treesitter.shell_command_selectors'
+local install = require'nvim-treesitter.install'
local health_start = vim.fn["health#report_start"]
local health_ok = vim.fn['health#report_ok']
@@ -47,12 +49,14 @@ local function install_health()
health_ok('`git` executable found.')
end
- if fn.executable('cc') == 0 then
+ local cc = shell.select_executable(install.compilers)
+ if not cc then
health_error('`cc` executable not found.', {
- 'Check that either gcc or clang is in your $PATH'
+ 'Check that any of '..vim.inspect(install.compilers)..' is in your $PATH'
+ ..' or set the environment variable CC or `require"nvim-treesitter.install".compilers` explicitly!'
})
else
- health_ok('`cc` executable found.')
+ health_ok('`'..cc..'` executable found. Selected from '..vim.inspect(install.compilers))
end
if vim.treesitter.language_version then
if vim.treesitter.language_version >= NVIM_TREESITTER_MINIMUM_ABI then