-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from xixiaofinland/dev
Dev
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
local M = {} | ||
local H = {} | ||
|
||
M.check = function() | ||
H.check_nvim_version() | ||
H.check_sf_cli() | ||
H.check_tree_sitter() | ||
H.check_fzf_lua() | ||
H.check_ctag() | ||
end | ||
|
||
-- helper; | ||
|
||
H.check_sf_cli = function() | ||
if vim.fn.executable('sf') ~= 1 then | ||
return vim.health.error("sf cli not found!") | ||
end | ||
|
||
vim.health.ok("sf cli found.") | ||
end | ||
|
||
H.check_tree_sitter = function() | ||
if not pcall(require, 'nvim-treesitter') then | ||
return vim.health.error("nvim-treesitter plugin not found!") | ||
end | ||
vim.health.ok("nvim-treesitter plugin found.") | ||
|
||
local parsers = require('nvim-treesitter.parsers').get_parser_configs() | ||
if parsers['apex'] == nil then | ||
return vim.health.error("apex parser not installed in nvim-treesitter!") | ||
end | ||
if parsers['soql'] == nil then | ||
return vim.health.error("soql parser not installed in nvim-treesitter!") | ||
end | ||
if parsers['sosl'] == nil then | ||
return vim.health.error("sosl parser not installed in nvim-treesitter!") | ||
end | ||
vim.health.ok("parsers found in nvim-treesitter.") | ||
end | ||
|
||
H.check_nvim_version = function() | ||
local v = vim.version() | ||
local v_in_str = string.format("v%s.%s", v.major, v.minor) | ||
|
||
if v.major == 0 and v.minor < 10 then | ||
return vim.health.error("installed Nvim version: " .. v_in_str .. ', plugin demands 0.10 or higher!') | ||
else | ||
vim.health.ok("nvim version ok: " .. v_in_str) | ||
end | ||
end | ||
|
||
H.check_fzf_lua = function() | ||
if not pcall(require, 'fzf-lua') then | ||
return vim.health.warn("Optional: fzf-lua not found. Some features for listing items won't work. You could install `ibhagwan/fzf-lua`.") | ||
end | ||
vim.health.ok("fzf-lua plugin found.") | ||
end | ||
|
||
H.check_ctag = function() | ||
if vim.fn.executable('ctags') ~= 1 then | ||
return vim.health.warn("Optional: ctags command not found in the path. Enhanced apex jump-to-definition won't work. You could install `universal ctags`.") | ||
end | ||
|
||
vim.health.ok("ctags command found.") | ||
end | ||
|
||
return M |