Browse Source

chore: format source code

my-config
github-actions[bot] 3 years ago
parent
commit
a7c98dd7ff
  1. 19
      lua/doom/modules/config/doom-neorg.lua
  2. 19
      lua/doom/modules/config/doom-treesitter.lua
  3. 2
      lua/doom/utils/init.lua

19
lua/doom/modules/config/doom-neorg.lua

@ -33,14 +33,23 @@ return function()
-- Check if user is using clang and notify that it has poor compatibility with treesitter
-- WARN: 19/11/2021 | issues: #222, #246 clang compatibility could improve in future
vim.defer_fn(function()
local log = require('doom.extras.logging')
local utils = require('doom.utils')
local log = require("doom.extras.logging")
local utils = require("doom.utils")
-- Matches logic from nvim-treesitter
local compiler = utils.find_executable_in_path({ vim.fn.getenv "CC", "cc", "gcc", "clang", "cl", "zig" })
local compiler = utils.find_executable_in_path({
vim.fn.getenv("CC"),
"cc",
"gcc",
"clang",
"cl",
"zig",
})
local version = vim.fn.systemlist(compiler .. (compiler == "cl" and "" or " --version"))[1]
if (version:match('clang')) then
log.warn('doom-neorg: clang has poor compatibility compiling treesitter parsers. We recommend using gcc instead, see issue #246 for details. (https://github.com/NTBBloodbath/doom-nvim/issues/246)')
if version:match("clang") then
log.warn(
"doom-neorg: clang has poor compatibility compiling treesitter parsers. We recommend using gcc instead, see issue #246 for details. (https://github.com/NTBBloodbath/doom-nvim/issues/246)"
)
end
end, 1000)
end

19
lua/doom/modules/config/doom-treesitter.lua

@ -78,14 +78,23 @@ return function()
-- Check if user is using clang and notify that it has poor compatibility with treesitter
-- WARN: 19/11/2021 | issues: #222, #246 clang compatibility could improve in future
vim.defer_fn(function()
local log = require('doom.extras.logging')
local utils = require('doom.utils')
local log = require("doom.extras.logging")
local utils = require("doom.utils")
-- Matches logic from nvim-treesitter
local compiler = utils.find_executable_in_path({ vim.fn.getenv "CC", "cc", "gcc", "clang", "cl", "zig" })
local compiler = utils.find_executable_in_path({
vim.fn.getenv("CC"),
"cc",
"gcc",
"clang",
"cl",
"zig",
})
local version = vim.fn.systemlist(compiler .. (compiler == "cl" and "" or " --version"))[1]
if (version:match('clang')) then
log.warn('doom-treesitter: clang has poor compatibility compiling treesitter parsers. We recommend using gcc, see issue #246 for details. (https://github.com/NTBBloodbath/doom-nvim/issues/246)')
if version:match("clang") then
log.warn(
"doom-treesitter: clang has poor compatibility compiling treesitter parsers. We recommend using gcc, see issue #246 for details. (https://github.com/NTBBloodbath/doom-nvim/issues/246)"
)
end
end, 1000)
end

2
lua/doom/utils/init.lua

@ -134,7 +134,7 @@ end
--- Searches for a number of executables in the user's path
--- @param executables table<number, string> Table of executables to search for
--- @return string|nil First valid executable in table
utils.find_executable_in_path = function (executables)
utils.find_executable_in_path = function(executables)
return vim.tbl_filter(function(c)
return c ~= vim.NIL and vim.fn.executable(c) == 1
end, executables)[1]

Loading…
Cancel
Save