diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2021-04-07 12:00:41 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <tomvig38@gmail.com> | 2021-04-07 13:00:42 +0200 |
| commit | bf0ae40cf4d185a589eb82349855ac3c03d073ae (patch) | |
| tree | 93decd58323cebb7052c3a88840a0f7a2ae2951f /lua | |
| parent | Update lockfile.json (diff) | |
| download | nvim-treesitter-bf0ae40cf4d185a589eb82349855ac3c03d073ae.tar nvim-treesitter-bf0ae40cf4d185a589eb82349855ac3c03d073ae.tar.gz nvim-treesitter-bf0ae40cf4d185a589eb82349855ac3c03d073ae.tar.bz2 nvim-treesitter-bf0ae40cf4d185a589eb82349855ac3c03d073ae.tar.lz nvim-treesitter-bf0ae40cf4d185a589eb82349855ac3c03d073ae.tar.xz nvim-treesitter-bf0ae40cf4d185a589eb82349855ac3c03d073ae.tar.zst nvim-treesitter-bf0ae40cf4d185a589eb82349855ac3c03d073ae.zip | |
fix(health): let CC check behave like in real installation
Fixes #1146
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/health.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index a97bb359d..e2896cd03 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 |
