added a lot of stuff
This commit is contained in:
@@ -2,10 +2,50 @@ local O = {};
|
||||
local lspConfig = require('lspconfig')
|
||||
|
||||
function O.setup(on_attach, lsp_flags, capabilities)
|
||||
local path = debug.getinfo(1).source
|
||||
local acpath = path:sub(2, #path - 7).."ltex-key"
|
||||
|
||||
local f = io.open(acpath, "r")
|
||||
|
||||
if f == nil then
|
||||
lspConfig['ltex'].setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
return
|
||||
end
|
||||
|
||||
io.input(f)
|
||||
local url = io.read("*line")
|
||||
local user = io.read("*line")
|
||||
local key = io.read("*line")
|
||||
io.close(f)
|
||||
|
||||
if user == nil or key == nil or url == nil then
|
||||
lspConfig['ltex'].setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
return
|
||||
end
|
||||
|
||||
lspConfig['ltex'].setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-GB",
|
||||
languageToolHttpServerUri = url,
|
||||
languageToolOrg = {
|
||||
username = user,
|
||||
apiKey = file
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user