optional ltex languagetool secret
This commit is contained in:
parent
7a5c8428c9
commit
44bb3db121
|
@ -52,12 +52,7 @@ M.ltex = {
|
||||||
"html",
|
"html",
|
||||||
"xhtml",
|
"xhtml",
|
||||||
},
|
},
|
||||||
languageToolOrg = {
|
-- load token and additional languagetool items later
|
||||||
apiKey = require "custom.secret.languagetool_token",
|
|
||||||
username = "accounts@cscherr.de",
|
|
||||||
languageToolHttpServerUrl = "https://api.languagetoolplus.com/v2/",
|
|
||||||
},
|
|
||||||
languageToolHttpServerUrl = "https://api.languagetoolplus.com/v2/",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -170,4 +165,17 @@ M.textlsp = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- load secrets
|
||||||
|
-- the secret module should just return a string with the token
|
||||||
|
local available, token = require("custom.utils").try_require "custom.secret.languagetool_token"
|
||||||
|
if available then
|
||||||
|
M.ltex.languageToolOrg = {
|
||||||
|
apiKey = token,
|
||||||
|
username = "accounts@cscherr.de",
|
||||||
|
languageToolHttpServerUrl = "https://api.languagetoolplus.com/v2/",
|
||||||
|
}
|
||||||
|
M.ltex.languageToolHttpServerUrl = "https://api.languagetoolplus.com/v2/"
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -30,38 +30,25 @@ M.treesitter = {
|
||||||
|
|
||||||
M.mason = {
|
M.mason = {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
-- general purpose
|
|
||||||
"purpose",
|
"purpose",
|
||||||
|
|
||||||
-- lua stuff
|
|
||||||
"lua-language-server",
|
"lua-language-server",
|
||||||
"stylua",
|
"stylua",
|
||||||
|
|
||||||
-- web dev stuff
|
|
||||||
"css-lsp",
|
"css-lsp",
|
||||||
"html-lsp",
|
"html-lsp",
|
||||||
"typescript-language-server",
|
"typescript-language-server",
|
||||||
"deno",
|
"deno",
|
||||||
"prettier",
|
"prettier",
|
||||||
|
|
||||||
-- c/cpp stuff
|
|
||||||
"clangd",
|
"clangd",
|
||||||
"clang-format",
|
"clang-format",
|
||||||
"cmake-language-server",
|
"cmake-language-server",
|
||||||
|
|
||||||
-- rust
|
|
||||||
"rust-analyzer",
|
"rust-analyzer",
|
||||||
"taplo",
|
"taplo",
|
||||||
|
|
||||||
-- python
|
|
||||||
"pyright",
|
"pyright",
|
||||||
|
|
||||||
-- english??
|
|
||||||
-- "write-good",
|
|
||||||
|
|
||||||
-- shell
|
|
||||||
"shellcheck",
|
"shellcheck",
|
||||||
"bash-language-server",
|
"bash-language-server",
|
||||||
|
"ltex-ls",
|
||||||
|
"shellcheck",
|
||||||
|
"taplo",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ M.tokenize_args = function(raw)
|
||||||
local in_str = false
|
local in_str = false
|
||||||
local str_seek
|
local str_seek
|
||||||
for c in string.gmatch(raw, ".") do -- iterate through all chars
|
for c in string.gmatch(raw, ".") do -- iterate through all chars
|
||||||
if c == ' ' and not in_str then
|
if c == " " and not in_str then
|
||||||
if string.len(current) > 0 then
|
if string.len(current) > 0 then
|
||||||
table.insert(t, current)
|
table.insert(t, current)
|
||||||
current = ""
|
current = ""
|
||||||
|
@ -50,18 +50,34 @@ end
|
||||||
--- @param t any variable
|
--- @param t any variable
|
||||||
--- @return string t_dumped t dumped to string
|
--- @return string t_dumped t dumped to string
|
||||||
M.dump = function(t)
|
M.dump = function(t)
|
||||||
if type(t) == 'table' then
|
if type(t) == "table" then
|
||||||
local s = '{ '
|
local s = "{ "
|
||||||
for k, v in pairs(t) do
|
for k, v in pairs(t) do
|
||||||
if type(k) ~= 'number' then k = '"' .. k .. '"' end
|
if type(k) ~= "number" then
|
||||||
|
k = '"' .. k .. '"'
|
||||||
|
end
|
||||||
if k ~= 1 then
|
if k ~= 1 then
|
||||||
s = s .. ', '
|
s = s .. ", "
|
||||||
end
|
end
|
||||||
s = s .. '[' .. k .. '] = \'' .. M.dump(v) .. '\''
|
s = s .. "[" .. k .. "] = '" .. M.dump(v) .. "'"
|
||||||
end
|
end
|
||||||
return s .. ' }'
|
return s .. " }"
|
||||||
else
|
else
|
||||||
return tostring(t)
|
return tostring(t)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Try to require a module
|
||||||
|
--- @param module string module name
|
||||||
|
--- @return boolean available is the module available?
|
||||||
|
--- @return any loaded_module the loaded module if it is available
|
||||||
|
M.try_require = function(module)
|
||||||
|
local available, loaded_module = pcall(require, module)
|
||||||
|
if not available then
|
||||||
|
return available, nil
|
||||||
|
else
|
||||||
|
return available, loaded_module
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Reference in New Issue